- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 07:06 AM
I have a requirement where i need to create two catalog tasks parallel on the basis of the application name. So in the workflow I'm trying to add the if condition that contains the application name.
Condition:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 01:14 AM
I believe application name is a variable on your catalog form and it's reference type
if yes then update as this
answer = ifScript();
function ifScript() {
if (current.variables.application_name.getDisplayValue().indexOf('OpenText') > -1) {
return 'yes';
}
return 'no';
}
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
01-09-2025 08:06 AM
Hello @Tamilvanan T
You are on right track, as code written is proper. Do let us know what is blocker? What is not working? Is there any part not working?
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 02:31 PM
May I point out that you could return the same checking state by using ternary operator?
Something like this will do the trick:
return current.application_name.indexOf('OpenText') > -1 ? true : false;
What do you think?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 01:14 AM
I believe application name is a variable on your catalog form and it's reference type
if yes then update as this
answer = ifScript();
function ifScript() {
if (current.variables.application_name.getDisplayValue().indexOf('OpenText') > -1) {
return 'yes';
}
return 'no';
}
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
01-15-2025 06:47 AM
It worked. Thank you!