I'm building a replacement for SharePoint 2010's "Collect Feedback" workflow. Actually, I've built a few of them, but in this scenario, I'm trying to do something a little different. I have a document library ("docs for feedback") and two lists ("reviewers" and "feedback"). What the department wants to do is start the feedback collection with a deadline specified at the time they start the flow. So, I've got a "for a selected file" trigger with an input of "Deadline Date" (there is no input that supports date AND time yet - the flow sets the deadline to be 5:00 PM local time on the date specified). The rest of the flow (in general terms) is:
I've thought through other ways to achieve this, but keep hitting walls. I need to assign them each an "approval" because each needs to be handled individually. If I were to have one approval assigned to all of the reviewers, it would either need to be "first to respond" or "wait for all responses", neither of which works for this process. Here's a screenshot of the "Apply to each" part of the flow. I'm almost certain that the solution to this problem is in there, but I can't find it.
Did you set the Apply to Each settings for Parallelism? Otherwise it will wait for each reply to be returned and for the deadline to be reached before it will exit the loop.
Sorry, I forgot to mention that. Yes, I set "Concurrency Control" to "On" and the "Degree of Parallelism" to 50 (see below). Prior to that, it would wait for the deadline or a response to generate the "next" approval.
That's one issue, but it will still wait until both parallel branches finish. so it will wait until each deadline passes even if the user responds to the approval before proceeding. Setting the parallelism means that they will all operate in parallel, which is good. But it will still wait for the Deadline.
Thanks, Peter. I understand that, and I'm OK with that behavior. But, now that I'm looking at it again, because they are parallel branches, it's going to wait for BOTH of them to finish. What I need is an OR gate in there. So, for each Reviewer, wait for them to respond OR the deadline. The problem is that I can't think of how to create that in Power Automate within that Apply to Each loop.
I can think of another approach (which I've used elsewhere) which would be to create the "feedback" item and have a separate flow that's triggered on that item being created to send and wait for the response or the deadline. Because it would be a single approver, there wouldn't need to be an "Apply to each" loop, which simplifies the whole thing a bit. It would just mean going back to the drawing board completely...or almost completely.
I've done something similar with a Do Until Loop instead of an Apply to each. In the deadline I do a pause loop and then check on the deadline or that the approval is complete (handled via variable). If either is done I exit the do until loop. Taht way the Deadline loop can complete earlier.
I thought about the variable to track the approval completion, but I don't think it'll work because the variable is "shared" by each iteration of the loop. So, let's say reviewer "A" responds and "varReviewComplete" is set to "true"; reviewer "B" does nothing, so when the deadline hits, the flow checks varReviewComplete and sees that it's set to "true", thus NOT creating the "no feedback" entry.
Thinking back to how the "Collect Feedback" workflow worked in SP2010, I think the workaround I mentioned may be the closest replication of that. In that OOTB workflow, it created a "Task" assigned to each recipient. In Power Automate, this can be split into two steps:
The only problem is "closing the loop" and going back to the item needing review to mark the process as "done". Although, I could just add a step in the first flow to wait until the deadline (plus a minute, just to be safe) and update the status. Or, set a column in that library for "number of reviews" - as each review is done or times out, it decrements that value. Although, that could result in multiple flows trying to update the same item at the same time and failing.
The variable won't work if you are doing parallelism. I was doing a serial flow.
But it sounds like you are one the right track.
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
Check out the community blog page where you can find valuable learning material from community and product team members!