Trigger action when client state parameter is changed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2025 01:51 AM
Hi,
In the UI Builder I want to execute "Client Script" when state parameter has change. My first approach was to get the data by Data Broker Server Script, and put 2 actions in "Events":
- Update state parameter
- Execute Client Script
But this operation is asynchronous and in the "Client Script" I doesn't have updated value in client state. Is there any option to force it to be synchronous? Or maybe can I add Event to "State Parameter" itself and trigger executing script when "State Parameter" is changed?
Best Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2025 06:29 AM - edited 09-03-2025 08:14 AM
Hi @mmorski
You can’t make actions synchronous in UI Builder. The solution is to use UI Builder's event-driven architecture. Instead of trying to force synchronous execution, you should trigger your client script with a separate event that you know will fire after the state parameter has been updated. This is commonly achieved using a component's Input value set event or a page-level Data changed event. This approach ensures your script always runs with the most current value.
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
