APIs & Integrations

LK165
Participante

String operator for "does not contain"?

resolver

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

0 Avaliação positiva
1 Solução aceita
IsaacTakushi
Solução
HubSpot Employee
HubSpot Employee

String operator for "does not contain"?

resolver

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 Takushi

Associate Certification Manager

Exibir solução no post original

2 Respostas 2
IsaacTakushi
Solução
HubSpot Employee
HubSpot Employee

String operator for "does not contain"?

resolver

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 Takushi

Associate Certification Manager
LK165
Participante

String operator for "does not contain"?

resolver

Thank you! It worked. Smiley feliz