- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2023 01:28 PM - edited 11-30-2023 07:52 PM
Hello community,
Using Flow Designer, how does one go about having a SC Catalog item variable, populate into the TASK description IF a specific value was chosen in the variable field?
I'm not sure how, using the "if" logic (if that's even the proper route)
The variable type is a Select Box with options ranging 0-10.
The goal is anything 1 or above would populate "Test" into the description. If it's 0, it would not populate.
TYIA.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2023 08:44 PM
in the catalog task action you can use inline script and handle it
if(parseInt(fd_data.trigger.request_item.variables.variableName) > 0){
return 'Test';
}
else{
return '';
}
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2023 08:44 PM
in the catalog task action you can use inline script and handle it
if(parseInt(fd_data.trigger.request_item.variables.variableName) > 0){
return 'Test';
}
else{
return '';
}
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 10:14 AM
Thank you so much @Ankur Bawiskar.
One more question if I may - If I wanted this done with not 1 but 2+ variables, how would I tie the 2+ scripts to run together.
Would I simply copy the script a second time and change the variable?
E.g.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2023 09:01 PM
Hi @Joel KP
When the catalog item/ record producer is submitted, the variable values will be stored in question_answer table.
May be you can have a action to look up the variable value for the submitted record and have your if logic and perform the next operations.