Filtered search with comma in search string

I am trying trying to use filtered search API to locate a sales account by name. The name has a comma in it. e.g. “My Company, Inc.” The comma is causing the search to not return the company.

POST /filtered_search/sales_account
{
    "filter_rule": [
        {
            "attribute": "name",
            "operator": "is_in",
            "value": "My Company, Inc"
        }
    ]
}

If I remove the company from the name in the CRM, the search finds the company. If I add it back into the sales account name, filtered search no longer finds it.

I tried a few ways to escape the comma with no luck. Is there any way I can locate a company that includes comma in the name.

Or is there an alternative to find a company by exact name (I’d rather not have to loop thru a list of returned items).

Hey @stevemc,
I’ve shared this query with the concerned team and they will get back to you soon.

was there any resolution to this?

Hi Steve,

Special characters are considered as separators in filtered search in Freshsales and so we won’t be able to accurately filter records with special characters while using the Filtered search API.

Alternate of using “contains_any” instead of “is_in”
In filtered search API, if you search using the “contains_any” parameter in the filter rule instead of “is_in” then you will get the sales account in response but it will contain all records which satisfy the condition. For example if you have two sales accounts with names “ABC, Inc” and “XYZ, Inc” and we trigger a filtered search API with “contains_any” - “ABC, Inc”, Freshsales will provide both the sales accounts in response because both contain “Inc” (since comma is considered as a separator).

One other alternate is to use the normal search API offered in Freshsales,

Here you can replace comma and space with “%2C” and “+” respectively in the GET API request. Following is an example where “Freshworks, Inc” is the record name,

GET 
https://domain.myfreshworks.com/crm/sales/api/search?q=freshworks%2c+inc&include=sales_account&per_page=25

Currently these are the only solutions.

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.