Hello,
I am building a workflow from a SP document library where multiple users need to approve documents once they are out of the draft stage and submitted for approval (i.e. 'Pending'). The workflow is able to send the approval request out to each user using "Start and wait for an approval" and is specified "custom responses - Wait for all responses". Note: users will change on each document, so I am using dynamic content to set the approvers with their email. However, the status of the document is automatically updated to "approved" when the first user responds. I created a "somewhat" workaround, where each users approval gets listed in another column using a string variable, but this makes the properties of the document change and then it reverts to a draft status. I am not using this workaround as it defeats the purpose of having the approval status in the first place.
The flow is as follows:
Trigger: When an item or file is modified
Trigger Condition- @equals(triggerOutputs()?['body/{ModerationStatus}'],'Pending')
Get file properties
Get file metadata
I am very new to Power Automate, so any feedback on this will be useful. It would be great if the status could remain pending until all users have approved the document or at the very least - let me know who has approved/hasn't approved without reverting the status to 'Draft'.
Thanks,
ksod
Solved! Go to Solution.
Hey there....so here's what's happening (great work so far, btw!)
The variable that you've created for the approvals is an Array (list), so when you create the approval and listed that variable as the assigned to, Power Automate automatically kicked off an Apply to Each loop. So, it starts working through your list of approvers and creates a different approval for each one. That's why the first one to approve kicks off all of the "approved" stuff.
The fix is to shift that variable to a String, and append each new name with a semi-colon in between. That way, Power Automate won't put it inside a loop, and will create a single Approval with multiple people rather than multiple approvals with just one person on it.
Once you do that, you will only have a single "Outcome" so you can get rid of that variable and that loop, right?
Hopefully, that's enough to move your game piece to the next square. Good luck, and keep us posted.
-Ed
If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.
Ed,
Ah! This worked. Here's how I did it. Now, the status remains 'Pending' until all approvers have responded! I still have the responses "apply to each" so that I receive a teams message with each approval, but that can be changed as well.
Thank you for your help, I was stuck on this for a while!!
- Kristen
Hey there....so here's what's happening (great work so far, btw!)
The variable that you've created for the approvals is an Array (list), so when you create the approval and listed that variable as the assigned to, Power Automate automatically kicked off an Apply to Each loop. So, it starts working through your list of approvers and creates a different approval for each one. That's why the first one to approve kicks off all of the "approved" stuff.
The fix is to shift that variable to a String, and append each new name with a semi-colon in between. That way, Power Automate won't put it inside a loop, and will create a single Approval with multiple people rather than multiple approvals with just one person on it.
Once you do that, you will only have a single "Outcome" so you can get rid of that variable and that loop, right?
Hopefully, that's enough to move your game piece to the next square. Good luck, and keep us posted.
-Ed
If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.
Ed,
Ah! This worked. Here's how I did it. Now, the status remains 'Pending' until all approvers have responded! I still have the responses "apply to each" so that I receive a teams message with each approval, but that can be changed as well.
Thank you for your help, I was stuck on this for a while!!
- Kristen
User | Count |
---|---|
92 | |
45 | |
21 | |
18 | |
16 |
User | Count |
---|---|
136 | |
49 | |
42 | |
36 | |
28 |