Dear All,
I am trying to create an Approval Flow with several stages. In the beginning, I am using Get Manager function and Get User (there is a place for manual email entry) seperately and create approval flows. Up to that point, it is going fine. But then I need to continue my flow with the approval's of the another department that has different emails for different approval steps. Therefore I am using an Excel file with emails of these approvers. This is where I am having a problem. While extracting those emails from the Excel, I am using "Get a Row" function and automatically it turns into "Apply to each". This is also fine. But the problem starts, when I am using this emails in my approvals, because, it also converts approval area to "Apply to Each". So I am receiving email everytime someone responds, not after all responses are complete. It is creating a little mess as I am not the only one who will use this flow, and people can't be sure when their flow will be totally completed. Is there a way to optimize this system? I've added some screenshots for your information. Any kind of feedback or ideas will be appreciated. Thank you in advance for your attention and support.
I wish you a great day.
Best Regards,
Yigit Yürüker
Solved! Go to Solution.
Create a string variable before you enter your loop. Call it something like ApproverEmails. In the Apply to Each loop where you are retrieving the Approvers emails append each email to the string variable followed by a semicolon. When you exit the loop create one Approval Action where the Approvers are the ApproverEmails variable. When the Approval returns you can check the outcome and send an email based on what happened. That way you only have one Approval.
Hi @yuruker ,
The reason for Apply to each here is that you use List rows present in a table action and reference the Dynamic content it outputs.
I want to know how the data in the Excel table relates to Approvers.
Each row represents an Approver, and it needs to perform approvals in order?
Please provide more details.
Best Regards,
Hello @v-bacao-msft ,
Excel table stores the emails of the approvers. That is why, I have to extract those emails from the excel. So, everytime Flow extracts the email from the excel file, it starts an approval process. That is fine. But unfortunately, it also sends me email of every approvers answer. I would like to have 1 single email in the end, telling me if it has been approved or rejected.
Create a string variable before you enter your loop. Call it something like ApproverEmails. In the Apply to Each loop where you are retrieving the Approvers emails append each email to the string variable followed by a semicolon. When you exit the loop create one Approval Action where the Approvers are the ApproverEmails variable. When the Approval returns you can check the outcome and send an email based on what happened. That way you only have one Approval.
I don't know what to say, marvelous!! Thank you for your time and effort. Very appreciated!