# String operator for "does not contain"?

**URL:** <https://community.hubspot.com/t/string-operator-for-does-not-contain/21215>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [May 27, 2020, 7:28pm UTC](https://community.hubspot.com/t/string-operator-for-does-not-contain/21215 "2020-05-27T19:28:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LK165](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lk165/32/76793_2.png) [@LK165](https://community.hubspot.com/u/LK165)\
**Post date:** [May 27, 2020, 7:28pm UTC](https://community.hubspot.com/t/string-operator-for-does-not-contain/21215/1 "2020-05-27T19:28:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [May 28, 2020, 7:07pm UTC](https://community.hubspot.com/t/string-operator-for-does-not-contain/21215/2 "2020-05-28T19:07:26Z")

</div>

Welcome, @LK165.

Thanks for reaching out. I’m happy to help.

It sounds like the `DOESNT_CONTAIN` `operator` may serve your purpose:

```auto
"filters": [
 [
 {
 "operator": "DOESNT_CONTAIN",
 "filterFamily": "PropertyValue",
 "property": "mypropertyname",
 "type": "string",
 "value": "ab;ac;abc;10;11"
 }
 ]
]

```

I [created a simple active list in-app](https://knowledge.hubspot.com/lists/create-active-or-static-lists) using the **“doesn’t contain any of”** filter and then retreived the filter definitions with [this endpoint](https://developers.hubspot.com/docs/methods/lists/get_list).

---

<div class="post-metadata">

**Author:** ![LK165](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lk165/32/76793_2.png) [@LK165](https://community.hubspot.com/u/LK165)\
**Post date:** [May 29, 2020, 9:21am UTC](https://community.hubspot.com/t/string-operator-for-does-not-contain/21215/3 "2020-05-29T09:21:28Z")

</div>

Thank you! It worked.  
 ![16x16_smiley-happy.png.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/2/22d5e40d253def47f5f4ea7f0e3e70be19010689.png)
