- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 07:22 AM
I'm trying to change the field label or question value dynamically on a Record Producer. This is an unmapped variable field whose label would change depending upon a value in another field.
For instance if I enter New in a dropdown I want another field label to say New Capacity: If I enter Add in the same dropdown I want the field label to say Add Capacity. I'll keep googling.
Thanks
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 07:31 AM
Hi Steve,
For simplicity and maintenance, I would approach these as two different fields and expose them with a UI policy (or two) rather than messing with the complexity of changing a field label. No code involved and the people who come behind you in the years to come will be happier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 07:27 AM
Hi Steve,
Use an onChange client script and use below code:
var field1 = g_form.getValue('dependent_value')
g_form.setLabelOf("your_field", field1);
Regards, Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 07:44 AM
I tried a g_form.setLabelOf("my field", "Add") and it didn't work. I found something that says that method doesn't work in the Service Catalog. A record producer is part of the catalog, right? I'll try again but I don't think it'll work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2017 12:06 AM
It should work, i'm using it in one of my record producer client scripts. What happens when you are trying the script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 07:31 AM
Hi Steve,
For simplicity and maintenance, I would approach these as two different fields and expose them with a UI policy (or two) rather than messing with the complexity of changing a field label. No code involved and the people who come behind you in the years to come will be happier.