cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Skipping approvers in a hierarchical approval process

I have a somewhat complex approval process to implement. When a new Form is submitted I want it to go to the User's supervisor for approval, then to the User's Director for further approval. A Director may or may not be the User's Supervisor's supervisor.  We have multiple Directors.  Each user is subordinate to one Director.  All Directors report to the CEO, who is at the top of the staff hierarchy. 

 

How do I get the Director's name for a given user?  Both the User and the Director will be in the same Dept.  The number of intermediate steps between User and Director varies.

 

The process we want is...  User --> Approver (Supervisor) --> Approver (Director)

 

In effect there is an unknown number of line managers.   The user's reporting relationships might be any of the following, with the desired approvers shown in red...

User --> Line Manager X --> Director  --> CEO

User --> Line Manager A --> Line Manager B --> Director --> CEO

User --> Line Manager G --> Line Manager H --> Line Manager J --> Director --> CEO

User --> Line Manager P --> Line Manager Q --> Line Manager R --> Line Manager --> Director --> CEO

 

We also have the special case where the User is the Line Manager immediately subordinate to a Director i.e.

Line Manager W --> Director

 

Except for the special case we need 2 approvals...

  • Approver 1 - The user's immediate line manager - GetManager (V2) does this nicely
  • Approver 2 - The relevant Director

How do I find the relevant Director in every case?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User III
Dual Super User III

I don't have access to a hierarchy like that so I can't show you a screenshot POC.  But here are the basic steps.

 

  1. Before entering the Loop create a variable to hold the Director's email address. Initialize it with the Manager's email who just approved.
  2. start a DoUntil loop
  3. Get the manager using the email in the variable. If the manager returned is the CEO then exit the loop and use the variable to send the approval.
  4. If not then store the manager returned in the variable and Loop.  repeat #3


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
Dual Super User III
Dual Super User III

For this kind of scenario your only real choice is to find or create some other data source where the hierarchy is maintained.  It doesn't seem like there is any specific way to determine the name of a particular user's director from the information stored in Office 365. 

 

The only possibility I see would be  dependent on an assumption.  The assumption is that the relevant Director always reports directly to the CEO and no one else in the chain reports to the CEO.  If that is the case you can use a Do Until loop after the first manager to walk the chain of managers until you reach the CEO.  The last manager before you reach the CEO would be the director.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

@Pstork1 - Thanks, I thought the same myself. The assumption that all Directors report the CEO is correct. I have a Do Until loop in my Flow at the right point but I don't know what to put in it.  I'm doing until what??  Until the current person's manager's email address is that of the CEO??  Conceptually I get it.  Practically I'm stumped as I don't know what to put in the Do Until loop.

Dual Super User III
Dual Super User III

I don't have access to a hierarchy like that so I can't show you a screenshot POC.  But here are the basic steps.

 

  1. Before entering the Loop create a variable to hold the Director's email address. Initialize it with the Manager's email who just approved.
  2. start a DoUntil loop
  3. Get the manager using the email in the variable. If the manager returned is the CEO then exit the loop and use the variable to send the approval.
  4. If not then store the manager returned in the variable and Loop.  repeat #3


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Hi @cymorg1,

Has your problem been solved?
If your problem has been solved, You could go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

Best Regards,
Community Support Team _ Lin Tu

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Top Kudoed Authors
Users online (7,531)