- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2017 09:53 AM
I am trying to set up a group approval that only marks the request "Approved" when 3 of the 4 members approve, we do not want it waiting for all 4, just until the first 3 that approve. We do not have different groups, all of the approvers are in the same group. I assume this needs to be done with the "Wait for: Condition based on script" approach. Does anyone have any ideas on this or a better way to do it? What we currently have in there is this:
var id,
count = 0;
for (id in groups) {
count += groups["bc1b9479db590700ee2df456bf9619cf"].approved; // Sums the total number of users who have approved from each group
}
if (count == 3) {
answer = 'approved'; // Approve if 3 users from any group have approved
}
else if (counts.requested == 0) {
answer = 'rejected'; // Reject if less than 3 users approved and no groups are still pending approval
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2017 09:56 AM
Hello Jeffrey,
You may find the below blog helpful.
https://www.servicenowguru.com/graphical-workflow/approval-percentage/

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2017 09:56 AM
Hello Jeffrey,
You may find the below blog helpful.
https://www.servicenowguru.com/graphical-workflow/approval-percentage/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2017 10:01 AM
Hi Jeffery,
I have used the following script to achieve something similar
var approvePercent = 50;
if((counts.approved/counts.total)*100 >= approvePercent){
answer = 'approved';
}
if((counts.rejected/counts.total)*100 > (100 - approvePercent)){
answer = 'rejected';
}
Thanks,
Nitin.
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2018 06:00 AM
if rejetced i need to remove the records from the related list.
kindly advise
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2018 08:41 AM
I used this for a percentage of approvers in the approval workflow.
I have 6 approvers. I only 3....
if (counts.approved/counts.total > .49) {
answer = 'approved';
}
else if (counts.rejected/counts.total > .10) {
answer = 'rejected';
}