I am using a multi select to add or remove users from a particular property.
The multi select options are bound to REST API of all available users.
Then, the initial values are bound to REST API of the users that are currently associated with the property.
I’m currently using the onChange event to trigger the API that has the logic to add/remove the user. I’m supplying the API the array of options in the multiselect.
The problem:
Upon page load, the workflow runs because the initial load of options is considered an onChange event.
This wouldn’t be too much of an issue, just an extra irrelevant call to the DB, but it triggers my success/error message. Which makes no sense on the UI.
Is there a way to only call the onChange event after the initial options are loaded into the multi select?
Actually, maybe I cannot use this element like this. It appears that the element is changing hundreds of times a minute.
I put a Fetch Collection in the error workflow so that the multiselect would sync to DB options onError, and it just keeps refetching the data over and over again.
Mmm I’m not sure. The dev team is planning a workshop on onChange events. I’ve added your use case to our user research so they can investigate further.
Hey Kevin,
Did you find a work-around to this?
I have a similar issue where I’m using several multiselect fields (as filters) with initial values. If I have only one field it runs the endpoint twice… which is not the end of the world, however each additional field calls the endpoint again. So it’s dog slow