String operator for "does not contain"?

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

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.

Thank you! It worked.
16x16_smiley-happy.png.png