Problem with operator IN

Hi! I have a problem when trying to search products using custom property. When I use “EQ” operator I’m getting a product as a result:

{ "filterGroups": [ { "filters": [ { "value": "VKBA 1355", "propertyName": "litium_productarticlenumber", "operator": "EQ" } ] } ], "properties": [ "litium_productarticlenumber" ]}

But when I try to do same search (and search with more values) using “IN” operator I’m not getting anything:

{ "filterGroups": [ { "filters": [ { "values": [ "VKBA 1355", "VKBA 3434" ], "propertyName": "litium_productarticlenumber", "operator": "IN" } ] } ], "properties": [ "litium_productarticlenumber" ]}

What am I doing wrong?

Hi @SNowak6

May I know if you receive any error messages while running your filter with “IN”?

By testing on a new dev account, I could fetch the default sample contacts with this query:

{
 "filterGroups": [
 {
 "filters": [
 {
 "values": ["bh@hubspot.com", "emailmaria@hubspot.com"],
 "propertyName": "email",
 "operator": "IN"
 }
 ]
 }
 ]
}

When you mean “not getting anything”, do you mean the api response is as such?

{
 "total": 0,
 "results": []
}

If you get a total 0, then the response is intended. If you have gotten any other error message, do share; it seems that your filter is correct, pretty much the same as what I used.

Cheers

WL

Yes, response was an object with empty results.

But during a test to get information for you I solved my issue: for some reasons, operator IN is case sensitive. But EQ is not. That’s why I was getting different results.