cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
blalor1
Advocate I
Advocate I

Approval Logic Problem

I'm building an approval flow and running into a logic issue.

 

Our Azure AD is complete with each person's manager.  For this particular flow, there will be 3 levels of heirarchy.  Mgr, Div Mgr and Div Exec.  Both Mgr and Div Mgr will be submitting the items to trigger the flow.

 

Scenario #1 -- Mgr submits item, it triggers the flow and the approval is sent to his Div Mgr.  If approved, the approval goes to the Div Mgr's Manager (Div Exec).  Pretty straightforward approval flow and no problems with this scenario.  I'm using the Get Manager action for the Mgr and the Div Mgr.    Mgr -->  Div Mgr --> Div Exec  At each approval level, the flow updates the SharePoint list with a different status so that the user knows where the approval is in the process and a custom email goes out to the user based on the level of approval.

 

Scenario #2 -- If the Div Mgr submits the item, it triggers the flow and approval is sent to his Div Exec.  If the Div Exec approves, there is no one above him in the heirarchy so I need the flow to stop after this step.  Div Mgr --> Div Exec

 

My question is if the Mgr is submitting, I want the flow to go through the two levels of approval, however, if the Div Mgr is submitting I only want the flow to go through one level of approval.  Because there are two approval levels set in the flow, when the Div Mgr submits to the Div Exec and it's approved at that level, the flow is expecting one more approval level.

2 REPLIES 2
v-xida-msft
Community Support
Community Support

Hi @blalor1,

 

Could you please share a bit more about your SharePoint list?

I suppose that there is Person or Group column in your SharePoint list to store these three users. The data structure of my SharePoint list as below:

RequestContent   Single line of text

Applicant               Person or Group

ApprovalStatus     Single line of text

 

On my side, the 3 levels of hierarchy as below:

Test5--> Test3--> Test1

 

I have made a test on my side, please take a try with the following workaround:

  • Add “When an item is created” trigger.
  • Add “Get manager (V1)” action, User (UPN) field set to dynamic Applicant Email content of above trigger.
  • Add a Condition, left input box set to Display name content of “Get manager (V1)” action, right input box set to Test3, within middle drop down, choose is equal to.
  • Within “If/yes” branch of “Condition”, add a “Start an approval”, Assigned to field set to Email content of “Get manager (V1)” action.

 

Add a “Condition 3”, left input box set to Response content of “Start an approval” action, right input box set to Approve, within middle drop down, choose is equal to.

 

Within “If/yes” branch of “Condition 3”, add “Update item” action, then add “Send an email” action. After that, add “Get manager (V1) 2” action, User (UPN) set to User Principle Name content of “Get manager (V1)” action. Then add “Start an approval 2” action, Assigned to field set to Email content of “Get manager (V1) 2” action. Add a Condition 2, left input box set to Response content of “Start an approval 2” action, right input box set to Approve, within middle drop down, choose is equal to. Within “If/yes” branch of Condition 2, add “Update item 2” and “Send an email 2” action.

 

  • Within “If/no” branch of “Condition”, add a “Condition 4”, left input box set to Display name content of “Get manager (V1)” action, right input box set to Test1, within middle drop down, choose is equal to.

 

Within “If/yes” branch of “Condition 4”, add “Start an approval 3”, Assigned to field set to Email content of “Get manager (V1)” action. Add a “Condition 5”, left input box set to Response content of “Start an approval 3” action, right input box set to Approve, within middle drop down, choose is equal to.

 

Within “If/yes” branch of “Condition 5”, add “Update item 3” and “Send an email 3” action.

 

Image reference:19.JPG

 Image of "Condition":20.JPG

 Image of "Condition 3":21.JPG

 Image of "Condition 2":22.JPG

Image of "Condition 4": 23.JPG

 Image of "Condition 5":24.JPG

 

The flow works successfully as below:25.JPG

 

 

 

 

 

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Kris...  thank you for the reply.  Actually, these users are not stored in a SP list, but rather pulled from the Get Manager function in Flow.  However, I did solve this by utilizing a work around.  I changed the job title of our executives to "Executive" and then set up conditions based on if the job title = "Executive".

 

Thanks, Bill

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,764)