Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Skipping approvers in a hierarchical approval process

(0) ShareShare
ReportReport
Posted on by 128

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?

 

  • v-litu-msft Profile Picture
    on at
    Re: Skipping approvers in a hierarchical approval process

    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

  • Verified answer
    Pstork1 Profile Picture
    66,824 Most Valuable Professional on at
    Re: Skipping approvers in a hierarchical approval process

    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
  • cymorg Profile Picture
    128 on at
    Re: Skipping approvers in a hierarchical approval process

    @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.

  • Pstork1 Profile Picture
    66,824 Most Valuable Professional on at
    Re: Skipping approvers in a hierarchical approval process

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >