- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2022 03:15 AM
Hello,
I have a Catalog item that is using a Variable set containing two variables
1) Requested By - Mandatory on Variable Level
2) Justification - Mandatory on Variable Level
I have to make these two variables non mandatory on one of the catalog item. Please let me know if there's a way (method) to achieve this using onLoad Client Script. Thanks in advance!
Regards,
Himesh
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2022 03:34 AM
Basically if the Variable is mandatory on the Variable level itself through the checkbox, then you can't make it not mandatory through UI Policy or Client Script. You simply can't. So you need to follow my approach if you want to achieve this.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2022 03:18 AM
Hi there,
You would need to change the variables in the Variable Set and set them to NOT mandatory. Then with a UI Policy (why Client Script?!) you can make the Variable mandatory for that particular Catalog Item by adding a UI Policy in the Catalog Item itself and adding a UI Policy Action to set the Variable to mandatory=true.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2022 03:23 AM
Hello
Thanks for the quick response!
I cannot afford to make it non mandatory on the field/variable level as they're being used in Several other catalog items. Can we not override a Mandatory variable on the field level using UI policy or any other methods?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2022 03:34 AM
Basically if the Variable is mandatory on the Variable level itself through the checkbox, then you can't make it not mandatory through UI Policy or Client Script. You simply can't. So you need to follow my approach if you want to achieve this.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2022 03:26 AM
Hey,
You have to make the fields non mandatory, and set them mandatory using UI policy in your variable set.
Then create one UI policy on your catalog item and have higher order
Aman Kumar