- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2014 09:28 AM
I've created a service catalog -> catalog item variable named "cmanager" having auto populated value based on selected user . During request, if user has no cmanager value, one task should create and if user has cmanager value task will skip , it will go for approval workflow. I'm creating an workflow for this catalog item and selecting 'If' condition from workflow activities. I feel for this 'If' condition I need to write a advance script. Can any one help how to write?
I have written below script and it is giving activity result No in both the condition :
answer = ifScript();
function ifScript() {
if(('current.variables.cmanager' != '')) {
return 'no';
}
else{
return 'yes';
}
}
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2014 09:35 AM
Try this below. You do not need the single quotes surrounding the variable.
answer = ifScript();
function ifScript() {
if(current.variables.cmanager != '') {
return 'no';
}
else{
return 'yes';
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2014 09:35 AM
Try this below. You do not need the single quotes surrounding the variable.
answer = ifScript();
function ifScript() {
if(current.variables.cmanager != '') {
return 'no';
}
else{
return 'yes';
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2014 09:49 AM
Hi Angela,
It is working fine now
Thank you very much for your help .

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2014 09:54 AM
Moderator note:
I moved this thread from Community Updates & Feedback to Support, marked it as a question, and flagged the reply above as "Correct".
thanks,
Lawrence