EQ vs IN Filter operator - can't get IN to work with values

Hi,

I’m trying to find a contact using the api using first+last name and company.

I’ve been using the EQ filter operator, but when I do the same query with IN, I get no results.

Example using

https://api.hubapi.com/crm/v3/objects/contacts/search

With body:

{
 "properties" : [ ],
 "filterGroups" : [ {
 "filters" : [ {
 "propertyName" : "firstname",
 "value" : "Bob",
 "operator" : "EQ"
 } ]
 } ]
}

I get lots of results

With body:

{
 "properties" : [ ],
 "filterGroups" : [ {
 "filters" : [ {
 "propertyName" : "firstname",
 "values" : [ "Bob" ],
 "operator" : "IN"
 } ]
 } ]
}

I get no results.

What am I doing wrong, please?

Hey, @JackPGreen :waving_hand: I have a request. As a caution, I have no documentation to back me up here, only my test + reading between the lines of a few community posts about IN operator frustrations.

Can you try the following, please:

  • Perform the same request, but make Bob lowercase — as in “bob”

  • It would be
    "values" : [ "bob" ],​

    vs

    "values" : [ "Bob" ],

I ran a quick test in Postman and once I used only lower case, it worked as expected. This isn’t documented anywhere I can find :frowning:

My request body

{
 "filterGroups": [
 {
 "filters": [
 {
 "propertyName": "firstname",
 "operator": "IN",
 "values": ["bob"]
 }
 ]
 }
 ]
}

My response

{
 "total": 4,
 "results": [
 {
 "id": "901",
 "properties": {
 "createdate": "2022-11-03T21:42:31.255Z",
 "email": "bob@bobsburgers.com",
 "firstname": "Bob",
 "hs_object_id": "901",
 "lastmodifieddate": "2022-11-17T15:03:49.006Z",
 "lastname": "Belcher"
 },
 "createdAt": "2022-11-03T21:42:31.255Z",
 "updatedAt": "2022-11-17T15:03:49.006Z",
 "archived": false
 },
 {
 "id": "1101",
 "properties": {
 "createdate": "2022-11-18T19:24:12.904Z",
 "email": null,
 "firstname": "Bob",
 "hs_object_id": "1101",
 "lastmodifieddate": "2022-11-18T19:24:52.852Z",
 "lastname": "One"
 },
 "createdAt": "2022-11-18T19:24:12.904Z",
 "updatedAt": "2022-11-18T19:24:52.852Z",
 "archived": false
 },
 {
 "id": "1151",
 "properties": {
 "createdate": "2022-11-18T19:24:35.852Z",
 "email": null,
 "firstname": "Bob",
 "hs_object_id": "1151",
 "lastmodifieddate": "2022-11-18T19:25:20.281Z",
 "lastname": "Two"
 },
 "createdAt": "2022-11-18T19:24:35.852Z",
 "updatedAt": "2022-11-18T19:25:20.281Z",
 "archived": false
 },
 {
 "id": "1201",
 "properties": {
 "createdate": "2022-11-18T19:24:46.289Z",
 "email": null,
 "firstname": "Bob",
 "hs_object_id": "1201",
 "lastmodifieddate": "2022-11-18T19:25:20.397Z",
 "lastname": "Three"
 },
 "createdAt": "2022-11-18T19:24:46.289Z",
 "updatedAt": "2022-11-18T19:25:20.397Z",
 "archived": false
 }
 ]
}

Please tell me if this works for you. Have fun building!

Best,

Jaycee

Thanks - lowercasing the string seems to have fixed it.

Wow, saved my day. I had already switched to /search endpoint because of this issue, now reverted back to bulk search, thank you!

Lowercase solution doesn’t work in many non-English character cases.

For instance, deal name: “İGA”

As we cannot find any deals with uppercase characters, we need to lowercase this.

Lowercase version: “iga”

This won’t return my deal, because iga != İGA. Now what?

@Jaycee_Lewis