Is it possible to loop through a selected file and get all the column name and values?
I am trying to create a workflow that send sequential approval for each document. Each document will have 3-7 approvers at anytime. The first approver will need to approve the document before it move on to the next. If the approver deny then the requestor will have to retrigger the flow to start off where the last person that approve.
For example: Approver 1 Approved -> Move on to Approver 2 -> Approver 2 Denied -> Requestor Trigger Flow again -> Restart over at Approver 2.
The logic that I am trying to implement.
1. User will upload the document
2. User will add approver emails and in what order in the columns below
3. User trigger the work flow on the selected file
4. Flow will loops through all the columns and look for column name contains "Approver [1-7]", and check the status column.
5. If Approver 1 have email address and status is blank then send an approval
6. If Approver 1 approve the document then update the column "status" and move on to the next approval. Repeat until completed.
7. If any of the approver deny a approval then update the status column and end the workflow
8. User will fix the document and retrigger the workflow and then it will start where the last approver deny the document. I guess it will check the status either it contain [blank] or deny and it contain an email.
Hi @pphan ,
Could you please share more details or a screenshot of the sharepoint library?
Will the sharepoint library have multiple approver column and it's corresponding status column?
Please share more details so we could better understanding your requirement and provide a proper workaround for you.
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @v-yuazh-msft ,
Sorry, I thought I have attached the image. Please see screenshot below. I have multiple approver columns and status column corresponding to them. I want a workflow to loop through each column and grab the email for the send approval action. Before it send it check if the approver already approve or not.
i love the business case you are describing having designed and implemented as similar system some time back before flow arrived.
1. I am wondering whether the current approach with Storing the individual approvers and their Staus at the file level will work or will be easy to program.
have you tried other approaches already?
if not I see the possible alternative route:
have an overall approval status for the file that you continuously update when ever a Approver makes a decision.
status could be
>>> approved by #1, approved by #2, ..., approval complete.
Or maybe even better
>>> awaiting approval #1, awaiting approval #2, ... approval complete
(makes it clear who needs to act next)
In order to avoid having 1 flow running for a very long time (7 approvers) you might be required to handle the actual cycling through approvers in a separate list,
Means that when approval work flow starts, the first flow actually is tasked to transfer each Approver name into a list that looks like:
document reference | approver email | status
once all entries in the approver lists are created , you trigger (http -> http) a second flow that cycles through the list and triggers the actual approval flow as individual approval processes, record individual approvals and update overall status on file level.
2. I am wondering whether allowing the file to be changed without erasing previously given signatures is a sound process from auditing perspective. The only person that sees the final version is the last approver and the recommendation might completely change between approver 1 and approver 7. Approvers 1 to 6 might agree to final version.
hope this helps. Keep us updated how project is progressing. It might be worth for a flow of the week article ...
Gives another idea how to handle:
> the use of multi value column.
How would it wok: Have all approvers in one multi value column field. Use an overall status as described above. In contrast to flow of the week article, don’t parallelize the approval process.
Check out the News & Announcements to learn more.
Check out the new Power Platform Community Connections gallery!
Congratulations, the new Super User Season 2 for 2021 has started!
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.