Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

How change field label dynamically in UI builder Form Component?

SiddhardhaN7964
Tera Guru

I am using form component in UI builder to edit existing record; I made the page working for editing; however, form component is limiting the label characters to 80. I know we have tooltip and all to help end-users to give more context / details. However, this requirement key for us to display entire label on form. Any alternatives to dynamically override a field label inUI builder form component? 


1 ACCEPTED SOLUTION

SundaramR
Tera Guru

 Hope this will be use full others.

 

 

/**
* @Param {params} params
* @Param {api} params.api
* @Param {TransformApiHelpers} params.helpers
*/
function evaluateProperty({
    api,
    helpers
}) {
    var fields = api.data.record.form.fields;
    fields.u_clarity_id.label = "Test Label";
    return fields;
}

 

View solution in original post

2 REPLIES 2

SundaramR
Tera Guru

 Hope this will be use full others.

 

 

/**
* @Param {params} params
* @Param {api} params.api
* @Param {TransformApiHelpers} params.helpers
*/
function evaluateProperty({
    api,
    helpers
}) {
    var fields = api.data.record.form.fields;
    fields.u_clarity_id.label = "Test Label";
    return fields;
}

 

Adding more details on where to configure this script. 

 

In UI builder:

Click on form component -> go to configuration (on right side) -> navigate to fields configuration and use data bind icon and configure the script.