Hello everyone, I hope you're okay.
Today I need to create an approval that considers the majority of votes, but the default options do not meet this scenario.
My approval flows today are:
1. Start approval with 5 voters, when it reaches 3 votes, voting must end;
2. Express flow - Start approval with 3 voters, when it reaches 2 votes the voting must be closed;
Has anyone ever needed something similar?
thanks in advance.
Solved! Go to Solution.
Hi @LucasLopesr ,
This solution outlined by @pawanjajoo may be of great use to you: Approvals with Majority in Power Automate - however, this isn't parallel, it's serial - one person at a time. Not sure if that's alright with you.
In the area where he has the "Increment Rejection", you could always have another condition that says "Is this more than half of the total? If so, end entire workflow." ...the problem though is that there isn't a "Terminate" inside of loops, and no way to say "Exit Loop". So it would continue to the end.
There is this workaround detailed out by @Anonymous Break Loop but as you'll see, it's quite a bit of work to implement.
Thinking about it a bit, in your scenario I might use a "Do Until". My flow might look something like...
1) Get the users into an array.
2) Count the users. Store in a variable.
3) Initialize each a rejection and approval variable, set to 0. Initialize a loop counter (eg, intLoopCounter) variable, set to 0.
4) Create a "Do Until" loop - set the condition to something like, "Until Rejection is higher than half the total votes" OR "until approval is higher than half the total voters" OR "until this has looped the same number of times that there are voters"
Inside the loop, it'd look like...
1) Increase loop counter by 1.
2) Get variables(arrVoters)?[intLoopCounter]
3) Start & wait for an Approval.
4) Condition based on outcome - increase Approval or Rejection.
That would the function until you hit a majority, or got through all people, and then end.
That's just thinking outloud. Let me know what you think.
Rhia
I answer questions on the forum for 2-3 hours every Thursday!
Hi @LucasLopesr ,
This solution outlined by @pawanjajoo may be of great use to you: Approvals with Majority in Power Automate - however, this isn't parallel, it's serial - one person at a time. Not sure if that's alright with you.
In the area where he has the "Increment Rejection", you could always have another condition that says "Is this more than half of the total? If so, end entire workflow." ...the problem though is that there isn't a "Terminate" inside of loops, and no way to say "Exit Loop". So it would continue to the end.
There is this workaround detailed out by @Anonymous Break Loop but as you'll see, it's quite a bit of work to implement.
Thinking about it a bit, in your scenario I might use a "Do Until". My flow might look something like...
1) Get the users into an array.
2) Count the users. Store in a variable.
3) Initialize each a rejection and approval variable, set to 0. Initialize a loop counter (eg, intLoopCounter) variable, set to 0.
4) Create a "Do Until" loop - set the condition to something like, "Until Rejection is higher than half the total votes" OR "until approval is higher than half the total voters" OR "until this has looped the same number of times that there are voters"
Inside the loop, it'd look like...
1) Increase loop counter by 1.
2) Get variables(arrVoters)?[intLoopCounter]
3) Start & wait for an Approval.
4) Condition based on outcome - increase Approval or Rejection.
That would the function until you hit a majority, or got through all people, and then end.
That's just thinking outloud. Let me know what you think.
Rhia
I answer questions on the forum for 2-3 hours every Thursday!
User | Count |
---|---|
90 | |
41 | |
22 | |
20 | |
16 |
User | Count |
---|---|
134 | |
53 | |
47 | |
36 | |
25 |