cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Roberts2727
Level: Powered On

Approval Flow

Hello, 

I created a 3 stage approval flow using the new flow tools, currently I have all three of the results from the previous approvers being mailed to me, I evaluate and if 2 of the 3 approvers approve then I hit the approve button on the fourth approval mail that kicks off the move from my proposed sharepoint list to my approved list and deletes the item in the proposed list. Working amazingly well! What I would like to do is use a conditional paramater to evaluate the result of the first 3 emails so that there is no manual intervention needed. Possible? I guess the question is does the conditional paramater accept an evaluation argument?

10 REPLIES 10
Roberts2727
Level: Powered On

Re: Approval Flow

@equals(body('Send_approval_email')['SelectedOption'], 'Approve')
and
@equals(body('Send_approval_email_2')['SelectedOption'], 'Approve')
or
@equals(body('Send_approval_email')['SelectedOption'], 'Approve')
and
@equals(body('Send_approval_email_3')['SelectedOption'], 'Approve')
or
@equals(body('Send_approval_email_2')['SelectedOption'], 'Approve')
and
@equals(body('Send_approval_email_3')['SelectedOption'], 'Approve')

 

 

Anyone that can help me make something like the above work?

flowuser
Level: Power Up

Re: Approval Flow

 

Format for logical and/or is basically @and(condition, or(condition, condition)) 

 

I don't quite understand what you're doing though, so I'll just leave it at that.

 

Roberts2727
Level: Powered On

Re: Approval Flow

 

When a new item is created in my list I want 3 approval emails to go out, then I want the conditional parameter to evaluate the responses, if 2 of the 3 = Approve then Yes, if not then no.

Roberts2727
Level: Powered On

Re: Approval Flow

Still not quite there...

 

@or(equals(body('Send_approval_email,Send_approval_email_2')['SelectedOption'], 'Approve'), equals(body('Send_approval_email,Send_approval_email_3')['SelectedOption'], 'Approve'), equals(body('Send_approval_email_2,Send_approval_email_3')['SelectedOption'], 'Approve'))

Roberts2727
Level: Powered On

Re: Approval Flow

@Sunay Is Staff available to help, I have been working on this for a while and cannot figure it out! Thanks in advance. I understand if its not possible. 

Power Automate Staff Sunay
Power Automate Staff

Re: Approval Flow

@Roberts2727  I think I understand your scenario. Your approval flow basically needs 2 approvals in stage 1 and then 1 approval in stage 2 for the copy to happen.

Let me look into it. I will update the thread soon. 

Roberts2727
Level: Powered On

Re: Approval Flow

@Sunay

 

First stage mails 3 approvers, if 2 of the 3 approve, then I want to move from the proposed to the approved list.

Power Automate Staff Sunay
Power Automate Staff

Re: Approval Flow

I checked, the way it works today is that as soon as any one of the approvers approve the flow will continue. This wouldn't work since flows are inherently stateless. 

We do plan to light up the For-each feature very soon (~2 weeks), which will make this scenario possible.

Alternatively, you can choose to store the state in an excel file and if conditions are satisfied copy over the item

Roberts2727
Level: Powered On

Re: Approval Flow

I do not mind storing in an excel file. I will attempt this and get back with you.

Roberts2727
Level: Powered On

Re: Approval Flow

Ok, I have edited the flow to write the results to an excel file with 2 columns named approved and denied, as well as a few other fields like title, assigned to email, and description for tracking purposes.

Next I run a get rows command and specify to retrieve all of the rows in the spreadsheet.

Next I have a condition

 

@greaterOrEquals(body('Get_rows')['Approved'], 2)

 

if yes create item

if no send email

 

Is that the appropriate logic for the condition to evaluate the approved columns?

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (5,019)