New help on changing the variable label text.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 05:07 PM
Hello,
I’m using g_form.setLabelOf('Old Phone Number', 'New Phone Number') method to dynamically change the label of a variable. While the label changes successfully on the portal, it doesn't update in the desktop view. Could someone please help?
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 05:18 PM
Is there a reason you do not just go to the variable definition and change it there?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 10:56 PM
Hi @DrewW
Thank you for your suggestion. We also can create two separate variables and hide or display them based on certain conditions. However, we would like to know if there is a way to dynamically change the label text using a client script. If the g_form.setLabelOf method works on the portal, why isn't it functioning in the fulfiller view?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 11:44 PM
Hi @Lisa Goldman ,
The first parameter of the setLabelOf method is the name of the variable (looks like you are passing the label for the variable)
g_form.setLabelOf('Old Phone Number',/*update this with name of the Variable*/ ,'New Phone Number')
If the issue still persists check for any errors in the browser console and share the screenshot of those errors.
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2025 03:10 PM
The original post was only an example. Below is the code I used to test it in my PDI. It works fine in the portal without any error messages. However, in the fulfiller view (RITM, TASK), the label did not change.
I'm testing this code in a Multiple Choice variable, when a option is select, the text label should change to 'New Phone', but it did not.
function onChange(control, oldValue, newValue, isLoading) {
if (newValue == 'yes') {
g_form.setLabelOf('old_phone', 'New Phone');
} else {
g_form.setLabelOf('old_phone', 'Old Phone');
}
}