How to display the condition variable on specific task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 05:54 AM
Hi Team,
Can anyone please help me on below requirement.
I have one requirement .I should display one variable on a specific catalog task. Currently, I have 4 SC tasks for that catalog item. If I select a variable value of No, then variable should be visible only on the 3rd task and not in other tasks, which means if I select No in other tasks, this variable shouldn't be visible.
Thanks,
Sasipriya.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 06:04 AM
you should use normal onLoad client script on sc_task table and check the variable value and short_description of catalog task and then show/hide
function onLoad(){
var variableValue = g_form.getValue('variables.variableName');
g_form.setDisplay('variables.variableName', false);
if(variableValue == 'no' && g_form.getValue('short_description') == 'short description of 3rd task'){
// show the variable
g_form.setDisplay('variables.variableName', true);
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader