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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Pulling all the groups...
Power Automate
Unanswered

Pulling all the groups and the planner data from the planner to a onedrive file.

(0) ShareShare
ReportReport
Posted on by 15
I am trying to pull all the groups, plans and tasks from the planner into a OneDrive file using a Power Automate flow. The flow has been running for 4 days and is producing output, but I would appreciate it if you could help me optimize the flow. Attached are the ss.
Categories:
I have the same question (0)
  • OSR - Oguri Profile Picture
    15 on at
    Here are the rest of the ss.
  • OSR - Oguri Profile Picture
    15 on at
    Any way to optimize the flow?
  • WillPage Profile Picture
    2,307 Super User 2025 Season 2 on at
    There's probably a lot you could do here to avoid so much nested looping.
     
    Given the plans are related to groups, you can start your loop of each group by doing a routine to get all the group members using the Office 365 Groups or Entra ID connector - this will avoid having to do an API call for each assignee within the loop later.
     
    Also, you may benefit from using a Select action to transform your arrays instead of appending objects to an array variable within a loop. Variables are quite resource heavy in the backend vs using data operations such as Compose and Select.

    My Approach to this would be:

    For each group:
    Get all users in the group
    Get all plans for the group
    For each plan
    List tasks
    List buckets
    Instead of looping round each bucket and appending to an array variable, use a Select action to transform the array
    For each Task, instead of getting the user profile (I assume this is the created by/owner of the task?) you can filter your array of group members from earlier
    Instead of for each assignee, use a Select to join the details from your array of users using xpath() See here: https://willpage.dev/2024/06/07/joining-tables-in-power-automate-logic-apps-with-xpath/
     
    Use the same technique to join bucket info to the tasks.
     
    N.B You can have a Compose inside an Apply to each loop (let's say it's called Inner Compose), then below the loop you can add another Compose and put the expression outputs('Inner_Compose') there, and the result will be an array with the contents of each compose from inside the loop for its items. This is waaay quicker than appending to a variable - however, it doesn't work in nested loops.
     
    Basically your goal is to have as few loops as possible - use Select and join using xpath. Keep any loops you must have to a single layer to produce a bunch of arrays by referencing a Compose inside the loop using another compose and thereby avoiding array variables. Then join the resultant arrays together at the end using Select and xpath.
     
    When you stop using variables and nested loops, you can set your loop concurrency right up to 50.

    This should speed your flow up massively.

    Even if you absolutely can't avoid those loops, it's much better to have an array of users ready you can filter rather than making an API call for each instance of the loop, especially when many of the tasks are going to have the same assignees, so you're looking up the same user's details from the API many times over during each run.
     
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard