Contacts API filter by FieldValues
I want to be able to retrieve contacts based on the value of a custom contact field.
I have been testing using the Swagger interface.
The following filters return errors:
Filter: member eq true and 'testfield' eq '12345'
Filter: member eq true and testfield eq '12345'
Error: Operator Equal is not supported for attribute testfield
Filter: member eq true and substringof('testfield', '12345')
Error: Operator Like is not supported for attribute testfield
The 'testfield' attribute seems to be valid, however the filters are not supported.
I could load all the contacts and filter them but isn't that wasting WA resources?
Any tips on how to get this done?
If this is not possible please let me know.
Found the issue. The filters work if the field is text not a number.
-
Michel commented
If the field is a number, then you may want to try this syntax:
Filter: member eq true and testfield eq 12345 (without any quotes)