Approval based on list collector value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2019 08:03 AM
Hi All,
I have created a variable as a list collector type and create a new table(contains value) which refer to the list collector variable.
Requirement is to attached the two level approval. First approval is the Requested for manager(Done) and second one is depend on list collector value.(If i selected more than one value in the list collector then it go for multiple approval). How can we attach approval based on list collector variable?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2019 08:12 AM
Hi Kun,
So if the list collector has 1 value then no second level approval is required
If list collector has more than 1 value then it should go to second level approval
So have an if activity and check following
answer = ifScript();
function ifScript(){
var listCollectorValues = current.variables.<listCollectorVariable>.toString();
if(listCollectorValues.split(',').length > 1)
return 'yes';
else
return 'no';
}
the yes output transition will take it to the 2nd level approval
the no output transition will skip and proceed to the next activity which you want
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2019 08:16 AM
In the above script, where we check the list collector value.
If user selected as A, then this is the approver.
If user selected as B, then this is the approver.
Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2019 01:12 AM
Hi Ankur,
Any update!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2019 01:40 AM
Hi Kun,
So you would require to get the displayValue for the list collector variable by querying the table it refers
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2019 02:37 AM
approvers depend on the list collector value selected in the field.
If i selected A in the field then it go for the approver to some one.
If i selected B then it go for the approver to some one.
If i selected both a and b then it will go for the approver to both