- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2020 06:35 AM
Hello,
I have record producer with 2 variable sets. I need to decide whether to show the second variable set based on the value that is entered in the first variable set. I assume that a UI Policy or a client script should solve this issue, however, it seems that accessing variables from another variable set is not a straight-forward task. Please let me know if you have tried something like this before.
Note: Both variable sets are multi-row variable set.
Thanks,
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 01:10 AM
Use the onSubmit client script on catalog item level.
Limitation MRVs
Note:
- Catalog UI policies and catalog client scripts defined at the item level are not applicable for variables in a multi-row variable set. Only those catalog UI policies and catalog client scripts defined within the multi-row variable set are applicable for variables in the multi-row variable set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2020 06:40 AM
Hi Mohammad,
you can use catalog client script on that 1st variable set; check the value of variable from 1st variable set and based on that show/hide the variable from 2nd variable set
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2020 06:47 AM
Hi Ankur,
Thanks for trying to help. Can you please provide me with more details because I already tried your solution but it didn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2020 09:37 AM
Hi Mohammad,
Can you share the script here?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2020 12:38 AM
Hi Ankur,
I have 2 variable sets: vs1 and vs2. vs1 consists of 1 variable called my_variable. If the value of my_variable is "A", I want to show vs2.
I created a client script with the following properties:
Applies to: A Variable Set
Type: Submit
Variable set: vs1
Script:
function onSubmit() {
var value = g_form.getValue("my_variable");
if (value == "A") {
alert("value is A");
g_form.setDisplay("vs2", true);
}
}