I have a UiPath form (new new modern form), and I would like to dynamically update a field’s description. I have tried using the “Run Form Script Activity”, but I don’t know what javascript to provide to update a fields description field. Can anybody help with this?
I have tried something like this, but it dosen’t work:
“form.getComponent(‘fldEmail’).then(function(component) {
component.component.description = ““Please enter your company email””;
component.redraw();
});”
Use the form’s internal formJson to modify the component’s description property directly, then trigger a re-render:
formJson.components.forEach(comp => {
if (comp.key === 'fldEmail') {
comp.description = 'Please enter your company email';
}
});
form.root.redraw();
Replace ‘fldEmail’ with your exact Field Key (check in Form Designer).
For dynamic descriptions, prefer Set Form Values activity instead of JS pass a dictionary with your field key and use FormFieldsInputData for metadata updates
Test in a form event trigger first. If it fails, share your exact field key/error
In the new modern forms the description property is not exposed for live updates. Changing component.component.description does not work because the form engine does not re-render that metadata at runtime. Only values and visible/disabled states can be updated dynamically. Descriptions and labels are static. The only workaround is to place a separate text field or html element and update that instead, because true description text cannot be changed through Run Form Script.