- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2021 09:02 AM
Hi,
My question seems pretty basic I guess but I need to be able to display some variables only on specific catalog tasks.
I guess I'll have to deal with catalog UI policies but I don't know where to start with this.
For example, in one catalog task I want to have this question "Do you validate the quote ?", but only in this particular CT, not anywhere else.
Is there a specific javascript chunk of code to write or it's simpler than that ?
Thanks.
Solved! Go to Solution.
- Labels:
-
Cost Management (ITSM)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2021 09:09 AM
Hi,
While creating Catalog Task from workflow you can ensure you show only the variables you want to be visible.
This can be done by selecting variables from Available to Selected section
OR
Sample script below if those variables are present on more than 1 task and you want to show only for 1
function onLoad() {
//Type appropriate comment here, and begin script below
var shortDescription = 'Your Task Short Description for which it needs to be visible';
if(g_form.getValue('short_description') != shortDescription){
// if that variable is mandatory then make it non-mandatory first
g_form.setDisplay('variableNane', false);
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2021 09:07 AM
Hi
If You want the variable to be available only at the Catalog Task then make sure you uncheck the highlighted and checked the remaining two either in UI Policy/Client Script

Please mark Correct✅/helpful if applicable, thanks!!
Aman
