- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2020 11:10 PM
Hi,
I have catalog form with some variables and a variable set with few variables
Now I want to make some variables mandatory on the variable set based on the variable value on the catalog form.
How can I achieve this.
Thanks in advance!!
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2020 11:39 PM
Hi,
got it
Please use onload catalog client script which applies on Catalog Item and not variable set
then you can access the variables inside variable set using g_form object
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
10-05-2020 11:18 PM
Hi Anusha
You have to create catalog UI policy on the particular catalog item
In catalog conditions, select the variable and then in Catalog UI policy Action select the variable you want to set as mandatory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2020 11:18 PM
Hi,
you can use onload catalog client script
Applies to Catalog Item
Applies on Catalog Task - True
function onLoad(){
if(g_form.getValue('variable') == 'your value'){
g_form.setMandatory('variable1', true);
}
}
You can also use Catalog UI Policy for this with no scripting
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
10-05-2020 11:32 PM
Hi Ankur,
I want to make variables in variable set mandatory based on variables on catalog form variable value.
if i use ui policy for catalog item. i am unable to access variables of variableset in ui policy actions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2020 11:39 PM
Hi,
got it
Please use onload catalog client script which applies on Catalog Item and not variable set
then you can access the variables inside variable set using g_form object
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader