May 27, 2020 3:28 PM - edited May 27, 2020 3:36 PM
Hi there, I'm new to using HubSpot Api and thought I would reach out for some help. I am writing a script to create a contact list using the API and I have a specific property (string type) which needs to be included in the filter criter such as :
{ "operator": "xxxxx",//xxxx needs replacing with appropriate operator
"filterFamily":"PropertyValue",
"property": "mypropertyname",
"type": "string",
"value":"ab;ac;abc;10;11"};
where the opertaor needed is the opposite of "CONTAINS" - equivalent to the SET_NOT_ALL operator, but for string values. Essentially if my property contains values such as:
xx_ab_aa
x_ac_ac
xx_aa_10
xx_xa_6
xx_ya_1
then only contacts with property values xx_xa_6 and xx_ya_1 should meet the criteria.
The error that showed when I tried SET_NOT_ALL is :
"status":"error","message":"Operator SET_ANY is not valid for this property type string.
TIA
Solved! Go to Solution.
May 28, 2020 3:07 PM
Welcome, @LK165.
Thanks for reaching out. I'm happy to help.
It sounds like the DOESNT_CONTAIN
operator
may serve your purpose:
"filters": [ [ { "operator": "DOESNT_CONTAIN", "filterFamily": "PropertyValue", "property": "mypropertyname", "type": "string", "value": "ab;ac;abc;10;11" } ] ]
I created a simple active list in-app using the "doesn't contain any of" filter and then retreived the filter definitions with this endpoint.
Isaac TakushiAssociate Certification Manager |
May 28, 2020 3:07 PM
Welcome, @LK165.
Thanks for reaching out. I'm happy to help.
It sounds like the DOESNT_CONTAIN
operator
may serve your purpose:
"filters": [ [ { "operator": "DOESNT_CONTAIN", "filterFamily": "PropertyValue", "property": "mypropertyname", "type": "string", "value": "ab;ac;abc;10;11" } ] ]
I created a simple active list in-app using the "doesn't contain any of" filter and then retreived the filter definitions with this endpoint.
Isaac TakushiAssociate Certification Manager |
May 29, 2020 5:21 AM
Thank you! It worked.