Label Variable Set Value (Service Portal)?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2016 05:57 PM
I have a Label type variable in a catalog item that I'm displaying through Service Portal.
I want to set the text of the label (called "change_window") through an onLoad Catalog Client Script.
I've tried g_form.setValue("change_window", "Whatever") and g_form.setLabelOf("change_window", "Whatever") but neither of those work (though they work fine for text fields).
Can anyone tell me how to set the text of the label?
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2016 07:12 PM
Nope. Doesn't look like it. None of that stuff works. Maybe it's just different in Service Portal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2016 10:18 AM
Hi Steve did you get this resolved? It's not working for me either.
Unable to set value to a Catalog Item Variable in Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 10:01 AM
From what I have found; the former method provided by SNGuru will not work with Service Portal due to the usage of $.
Supported and unsupported client scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2017 06:26 AM
Did you ever find a solution to this?
Mark's solution works great if you aren't using the Service Portal. But how do you change the field label in the Service Portal in an onChange Catalog client script?
Please mark this response as correct and/or helpful if it assisted you with your question.
Steven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2018 12:12 PM
Same goal here...has anyone figure out how to dynamically change the "Question" for a variable on a catalog item in Service Portal?
One thought I had was to create simple widgets with the necessary text and have that appear above my variable field, which could then have a blank "Question".
Then based on my logic, I can present whichever text (via the widget in a macro field).
But that said, is there any script that could handle changing the variable's Question?
Thanks!