How to set field value in Form component - UI Builder
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 06:29 AM
Hello,
I'm trying to do simple thing in UI Builder but I cannot find a solution that will work correctly.
On my form I have two fields: select box and text field. Based on the selection in select box I want to automatically populate a text field with some value and later save it with custom button by triggering Save action from the form data resource.
Is there any way I can achieve above?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 07:26 AM
HI @Bartek0301
That should be straightforward, there are a few ways, one easy way is
1. create a client state like below
2. the component emits a payload, for example, I use a search box, and it emits searchTerm. Map this searchTerm to the client state created in step 1.
3. Now, the target component is mapped to display the client state.
so if you now type anything in the search component, it will reflect in the bottom text component.
result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 07:53 AM
Hello @Muralidharan BS
Thank you for the reply.
Your example is related to the custom inputs. In that case I am able to configure this behavior.
But I'm trying to achieve the same directly in the form component, for example I want to use Form component to show incident form and when I select one of the category I want to set some description and later save the form using custom button.
I tried to use client script and set the value by referencing to the field from form data resource and indeed I was able to set the value, but when I tried to save it, the value reverted back to the previous one.
Interesting is that when I did the same, but before saving I've just clicked on the updated field, everything work...
It seems like a bug but I can't rely on users will click on the field before saving. So I'm looking for some other options.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2025 12:01 AM - edited 01-16-2025 12:03 AM
Hi @Bartek0301 ,
did your custom save button perform actual update on the backend? Is it the problem that save button is working on Form but it's not displaying updated value after successful save?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2024 09:10 AM
Hey @Bartek0301
Were you able to find a solution, I'm facing same issue ?
How you were able to resolve it ?