How to Use itemSearch for Multiple Options Custom Fields?

Edson de Paula
Edson de Paula Member Posts: 2 VERIFIED MEMBER
Name Dropper First Comment

I’m trying to use the itemSearch to get all companies with a custom field of the "multiple options" type, but the request is returning no results.

How can I search for companies that have a specific option set in a custom field of the "multiple options" type?

For example, the custom field name is "category" and it has two options: “Client” and “Partner”. I’d like to search for all companies that are categorized as clients.

Here is the request I'm using:

{{baseUrl}}/itemSearch/field?term=client&field_type=organizationField&field_key=bbdb2eef7e65dcb531086fb3ba9c8cdddd514f14&return_item_ids=true

This version clarifies your intention and provides the necessary details in a more organized manner.

Tagged:

Best Answer

  • Manuel Oliveira
    Manuel Oliveira Admin Posts: 1,259 COMMUNITY MANAGER
    1000 Comments 250 Likes 25 Answers Third Anniversary
    #2 Answer ✓

    Hi @Edson de Paula Is your field single or multiple option type? If so that could be the reason, as itemSearch will search by values under text, large text, numerical, monetary, autocomplete, phone and address type custom fields.

    Instead, you can try creating an organization filter that finds all companies with that specific option and then using GET/v1/organizations with filter_id being the id for the specific organization filter you want to apply.

Answers