Can you reuse a Variable Set and show a different question for the field each time

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2022 10:57 PM
Is there a way to use an existing Variable Set in multiple forms, but have it display a different question.
For example, the variable set is called Office and it has 5 options: Hobart, Melbourne Sydney, Perth and Adelaide.
On form 1, I want the question to be: In which office are you located?
On the form 2, I want the question to be: Which office should receive delivery?
On form 3, I want the question to be: Where is your home base?.
Each time I want them to be shown the same 5 options.
And when we open another office, say Darwin, I want to update the Variable set once, and it to be reflected in all three forms. Is there a way to do this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2022 12:12 AM
Hello,
You can try using setLabel(String fieldName, String label) method in variable set and give catalog name as well in conditions but most probably this won't work and you can only do this with DOM manipulation which servicenow doesn't recommend.
So what I suggest is you remove that variable from variable set and create seperate individual variable for each catalog item, if you cannot remove variable from variable set then at least hide variable for those catalog items and display single seperate variable for them.
This is the best approach for your scenario
Please hit like and mark my response as correct if that helps
Regards
Regards,
Musab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2022 10:39 PM
Thanks Musab,
Creating the catalog client script did as you outlined. Thanks for the help. Example included below.
function onLoad() {
//Type appropriate comment here, and begin script below
g_form.setLabelOf('Office', 'In which office are you located? ');
}