workflows - branched IF conditions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2016 03:14 AM
I previously had this working from the mini-lab https://community.servicenow.com/community/develop/blog/2015/10/18/mini-lab-workflows--playing-with-...
On a different project now and I want to employ the same again...
I am struggling to get the Condition to pay attention to the results in the script??
The script as follows:
activity = ifScript();
function ifScript() {
var result = {VALUE1:false,VALUE2:false, VALUE3:false, VALUE4:false};
if (VariableFieldValue == 'true') {
result.VALUE1 = true;
}
result.VALUE2 = true;
result.VALUE3 = 'true';
return result;
}
I have 4 conditions for the IF statement branches,
and so on...
I have also included some logs in the script and can see that the result.VALUEs are being updated, so it seems I am accessing the values incorrectly in the conditions to catch the output flows
when i had it without activity.result and just result.VALUE (no activity.) it was throwing an unbound or wrapped exception on result
- Labels:
-
Service Catalog
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2018 02:08 AM
I appreciate this approach - worked like a charm for me.
The switch statement made the most sense but it only supported catalog variables instead of workflow variables.
This did the trick for me - nice work.
Kurt