palantir-foundryfoundry-slate

How do I trigger an action in Slate after a dropdown changes?


I want to submit an action in Slate as soon as a dropdown value changes (the action should take the selected dropdown value as a parameter).

The dropdown: w_dropdown_1

The action form: w_foundry_action_1 with enter image description here

I added an event like the one below: enter image description here

But my action is sometimes submitting with the previously selected dropdown value.


Solution

  • This happens because the action updates its parameter based on the dropdown at the same moment that the form is submitted with neither event necessarily occurring before the other.

    Instead of triggering the action as soon as the dropdown changes, you can add an event to validate the action form: enter image description here

    When the dropdown value changes, the action form w_foundry_action_1 will be validated. Once successful, it will submit the action with the correct value.