- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2016 11:28 AM
Hi Team,
IN Knowledge Management, we have one List collector type field "" this field contains Malaysia, Japan, China etc..For example, if I'm selecting Malaysia, Japan, China countries, based on these countries we need to send approval request their respective managers.
For Malaysia the approval request mail will send to two persons (managers)
For China the approval request mail will send to one manager
For Japan the approval request mail will send to three managers.
Previously, "" is a drop-down field and it contains above country name. So, in workflow we simply using switch case, approval user and send approval request mail to respective managers.
But, here my query is how to get "" values in workflow and how to send individual approval request to respective mangers.
Please suggest a solution/helpful script/workflow, to how can i get Article for and how to send individual approval request to respective mangers.
Previous Workflow: Previously "Article for" is a drop down values. But now it is a list collector type.
1. Field
2. Previous Workflow
Please suggest how can I update this workflow with present situation.
Thanks & Regards,
Prasanna Kumar
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2016 11:46 AM
Hi Prasanna,
You can click on advanced checkbox on approval activity and then trigger it based on your logic.
Script :
var answer =[];
var arrayUtil = new ArrayUtil();
var list = current.list_collector.getDisplayValue().toSring();
var arrayList = list.split(",");
if (arrayUtil.contains(arrayList, "Malaysia")) { //for ex if it is Malaysia
answer.push('PASS SYS_ID OF THE APPROVAL USER');
}
You can adjust the above code as per your logic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 03:12 AM
Hi Tomasi,
Thank you for your reply. It is working exactly, what we have expected. Thank you for your rapid feedback.
Thanks & Regards,
Prasanna Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 03:26 AM
You are very welcome. The important thing to note is to use getValue() when dealing with GlideRecord sys_ids in a loop.
Please mark my answer correct so others can find it quickly if they have the same question or issue. Thank you and good luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2017 01:27 PM
Pradeep,
Can you use this similar logic to create task for individuals based on items from a List Collector? So if "China" was one of my items in the List Collector array, could it flow down that branch of the switch and create a Catalog Task for a user instead of a Approval Request? Also, do you have to use "contains"..can you use some form of "equals"?
Please mark this response as correct and/or helpful if it assisted you with your question.
Steven

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2017 01:34 PM
Hello Steven,
You can use "If" activity in the workflow and return true or false based on your logic. Based on the output you can point it to the next actiity to create catalog task.
Script:
answer = ifScript();
function ifScript() {
var arrayUtil = new ArrayUtil();
var list = current.list_collector.getDisplayValue().toSring();
var arrayList = list.split(",");
if (arrayUtil.contains(arrayList, "Malaysia")) {
return 'yes';
}
return 'no';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2017 01:39 PM
So in your example, you would need an IF activity for each possible item in a List Collector correct? Which obviously could be a lot of If statements if they had 30-40 choices in a List Collector. Also, can you use something different than ".contains"? Some of our choices are similar in name.
Please mark this response as correct and/or helpful if it assisted you with your question.
Steven