Have to make a variable inside the variable set mandatory based on another variable on catalog form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2022 12:58 PM
Have to make a variable inside the variable set mandatory based on another variable on catalog form.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2022 01:11 PM
Hi,
You can use a client script on the variable set and sample script such as:
if (parent.g_form.getValue('field_name') == 'value') {
g_form.setMandatory('field_name', true);
}
Keep this guidance in mind as well for MVRS and mandatory field situations: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0778516
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2022 01:21 PM
You need a Catalog UI Policy or Catalog Client script on the Catalog item level instead of variable set level.
Creating it at catalog item will allow you to select variables across variable sets associated to the catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2022 02:04 AM
I don't think a UI policy is going to work as we need to make the variable inside the variable set mandatory .
I tried doing this we cant fetch variables from variable set.
I am looking for a client script instead.
Thanks