- 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-11-2020 12:01 PM
I'm sorry. I couldn't understand your answer. It gets inside the if-statement but the problem is that it doesn't hide the field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2020 12:43 AM
Hi,
few things to check; I believe you can have that as onChange client script instead of onSubmit; but that is fine; just check what value comes for that variable in alert
var value = g_form.getValue("my_variable");
alert('Variable value is: ' + value);
if (value.toString() == "A") {
}
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:55 AM
Hi, The value is retrieved correctly from my_variable. I already checked that.
I also tried making it run onChange and tweaked the code accordingly. I also tried making the client script run on the catalog item level. I also tried UI Policy. I ended up posting this question only after trying all the obvious solutions.
Note: Obviously it is not an issue of whether it goes inside the if statement or not. It is an issue of whether the second variable set is accessible from here or not.

- 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.