
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2017 10:34 PM
Hey,
I need a help.
How to check variable is present in Variable Editor or not in Catalog Task?
But that field is in Service Catalog.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2017 03:17 AM
Hey Robbie,
I resolved my Issue by trimming short description field from sc_task like this -
var fc = gr.variables.ssaw_name_subcontractors.getDisplayValue();
var sc = gr.variables.ssaw_name_subcontractor2.getDisplayValue();
if(gr.short_description.indexOf(fc) != -1)
{
str=str+"<tr>"+"<td style='border: 1px solid black'>"+gr.variables.ssaw_name_subcontractors.getDisplayValue()+"</td>";
gs.log('FC:'+ gr.variables.ssaw_name_subcontractors.getDisplayValue());
}
else if(gr.short_description.indexOf(sc) != -1)
{
str=str+"<tr>"+"<td style='border: 1px solid black'>"+gr.variables.ssaw_name_subcontractor2.getDisplayValue()+"</td>";
gs.log('SC:'+ gr.variables.ssaw_name_subcontractor2.getDisplayValue());
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 01:48 AM
Hi Nayan,
There are a few attributes that enable a Catalog variables visibility throughout the tool which can be edited on the 'Visibility' tab when opening the variable.
However, in order for a variable to be seen in the Variable editor on the task form, ensure the 'Global' attribute is set to true. Its a hidden attribute.
See below:
Please mark correct and/or helpful by clicking on your post link (How to check variable is present in Variable Editor or not? ) to help close out open questions and also aid others with the same/similar questions.
Thanks,
Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 03:24 AM
Hi Nayan,
How did you go?
Please mark correct and/or helpful by clicking on your post link (How to check variable is present in Variable Editor or not? ) to help close out open questions and also aid others with the same/similar questions.
Thanks,
Robbie

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 03:35 AM
I am trying to compare in scheduled script like this -
var fc = gr.variables.ssaw_name_subcontractors;
var sc = gr.variables.ssaw_name_subcontractor2;
if(fc != '' || fc!= 'undefined' || sc == 'undefined')
{
str=str+"<tr>"+"<td style='border: 1px solid black'>"+gr.variables.ssaw_name_subcontractors.getDisplayValue()+"</td>";
gs.log('FC:'+ gr.variables.ssaw_name_subcontractors.getDisplayValue());
}
if(sc != '' || sc!='undefined' || fc =='undefined')
{
str=str+"<tr>"+"<td style='border: 1px solid black'>"+gr.variables.ssaw_name_subcontractors.getDisplayValue()+"</td>";
gs.log('SC:'+ gr.variables.ssaw_name_subcontractor2.getDisplayValue());
}
but the names came from Catalog Task like this and i dont want to show both names at same time because that variables is depend on Short_description -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 04:43 AM
Hi Nayan,
If I understand your question correctly, you're wanting to control whether a variable is displayed on a Catalog task (on the Variable Editor section) based on the Short Description? Is that correct?
For this you could create a UI policy script for example and leverage the set the display method - g_form.setDisplay(fieldname, true/false) to control this based on your chosen condition.
Thanks,
Robbie