Handling choosing all visible people in JSON modal

Hello,

Would appreciate your assistance / advice about a JSON modal issue I have.
I noticed that when I choose all visible people for me, the API sent to me by pipedrive has an empty string value for “selected_ids” attribute.

As I do not know which filter the user used to see the list of people, I cannot determine which ones he actually chose. For the moment, I will need to get a list of all persons, and run actions over all of them, even though he did not actually choose them.

The people filter is:

image

Example of choosing all people is like:

Example from my JSON modal:

image

It clearly states that the action will be invoked over 10 persons.
However, the API we get from Pipedrive, does not include 10 ID’s, just an empty string:
{‘company_id’: 13554273, ‘user_id’: 21725199, ‘resource’: ‘person’, ‘modal’: ‘match_contacts’, ‘selected_ids’: ‘’}

How can I get the selected ID’s in case I choose all contacts in a specific filter?
I want to run the action only over specific persons.
Appreciate your help on this matter.

Hello @Imanuel_Mizrahi ,
Pipedrive Docs You should examine the explanations in this document in detail. If all the results in a filter are selected, the selected_id will be empty. So you can understand from here whether all are selected or not.

You can find the filter as follows: if the filter_id is coming, it has created a special filter. If there is no filter_id and only user_id, it means that it has selected the user from the owner tab. In other words, you can only find the results that this person is responsible for with the filter.

Thank you @MFener ,
I was mainly looking into the “json-modals” in the docs, and not in the “links action” so I missed it.

Appreciate your response!

1 Like