Only trigger multiselect onChange even after initial values are loaded

Hi.

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:

  1. 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?

Thank you.

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.