web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Answered

Org Chart Nested Loop

(0) ShareShare
ReportReport
Posted on by 108

Hey all, 

 

Been stuck at this problem for a while now and it's driving me crazy. 

I'm using "Get Direct Reports" (office 365 connector) and I'd like to one individuals name in and get all of their direct reports' indefinietely until there are none left and append them all to a list. 

 

The theory is simple but I'm having trouble implementing it. Any help would be appreciated

Categories:
I have the same question (0)
  • HenWang Profile Picture
    Microsoft Employee on at

    Hi @CameronTCD ,

     

    I am afraid there is no other way to avoid this issue. To conclude, adding enough number of nested loop to check whether the guy has direct reports or not is the final way.

     

    First part:

    HenWang_0-1683171366829.png

    check the first guy whether he has direct report.

     

    The following loop:

    HenWang_2-1683171568463.png

     

     

    Inside the condition, there are same configuration to check whether the specific user has direct reports.

     

    Best Regards,

    Hen Wang

  • Verified answer
    CameronTCD Profile Picture
    108 on at

    Hey @HenWang thanks for taking the time to reply.

    After a lot of trial and error I managed to configure it in such a way that it works!

     

    With a combination of a few variables, a loop and two for each the Flow will drill down from one individual and find every single person under them organisationally.

    first stepfirst stepsecond stepsecond stepthird stepthird step

  • DR-30071856-0 Profile Picture
    2 on at
    Thanks for providing the example, I'm trying to do something similar.
     
    Could you please expand on the setp: "How many direct reports does this person have?".

    I don't quite get what you are doing here. Thanks so much.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 308 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 171 Super User 2026 Season 2

#3
Haque Profile Picture

Haque 137 Super User 2026 Season 2

Last 30 days Overall leaderboard