- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2022 06:11 AM
Hi,
I have a catalog item with one of the variables as a list collector. I have two options which are "Add / Modify Application Access" and "Get iManage Add-in". If I choose "Add / Modify Application Access" option then it should trigger an approval and catalog task etc, In the same way, if I am selecting Get iManage Add-in then it should trigger a different catalog task and the flow goes on. I have handled both the scenarios in my workflow with the switch.
The challenge I am facing is if I am selecting both the options then it should trigger both the flows. I handled that also inside switch as a condition but in spite of just triggering the both condition alone, it is triggering the other two conditions along with both. Hence it is creating a mess triggering multiple tasks and approvals. How to handle this if I am selecting both the values and it should trigger the flow accordingly?
Below are my conditions added inside the Branch activity:
Add / Modify Application Access- current.variables.request.toString().indexOf('f39a272a1b4fc1900dd7fdd91d4bcbd9') != -1
Get iManage Add-in- current.variables.request.toString().indexOf('a7aa272a1b4fc1900dd7fdd91d4bcb93') != -1
Both- (current.variables.request.toString().indexOf('f39a272a1b4fc1900dd7fdd91d4bcbd9') != -1) && (current.variables.request.toString().indexOf('a7aa272a1b4fc1900dd7fdd91d4bcb93') != -1)
Attaching the screenshot of the workflow.
Solved! Go to Solution.
- Labels:
-
Service Catalog
-
Workflow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2022 07:39 AM
You don't need to build logic by scripts:
Use if condition workflow activity and if script:
answer = ifScript();
function ifScript(){
var req = current.variables.request.toString();
if(req.indexOf('a7aa272a1b4fc1900dd7fdd91d4bcb93') != -1)
return 'yes';
else
return 'no';
}
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2022 06:18 AM
Hi Aadarsh,
Can you please share code snippet of the Branch.
Most probably the cause of this malfunctioning seems to be in that script.
Please mark helpful/correct as applicable.
Thanks and Regards,
Rahul
Thanks and Regards,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2022 06:30 AM
I haven't added anything to Branch instead I have added conditions as mentioned below:
Below are my conditions added inside the Branch activity:
Add / Modify Application Access- current.variables.request.toString().indexOf('f39a272a1b4fc1900dd7fdd91d4bcbd9') != -1
Get iManage Add-in- current.variables.request.toString().indexOf('a7aa272a1b4fc1900dd7fdd91d4bcb93') != -1
Both- (current.variables.request.toString().indexOf('f39a272a1b4fc1900dd7fdd91d4bcbd9') != -1) && (current.variables.request.toString().indexOf('a7aa272a1b4fc1900dd7fdd91d4bcb93') != -1)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2022 06:22 AM
Hey,
Can you share the complete code, for to be able to understand?
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2022 06:31 AM
I haven't added anything to Branch instead I have added conditions as mentioned below:
Below are my conditions added inside the Branch activity:
Add / Modify Application Access- current.variables.request.toString().indexOf('f39a272a1b4fc1900dd7fdd91d4bcbd9') != -1
Get iManage Add-in- current.variables.request.toString().indexOf('a7aa272a1b4fc1900dd7fdd91d4bcb93') != -1
Both- (current.variables.request.toString().indexOf('f39a272a1b4fc190