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 / Optimizing flow : dura...
Power Automate
Suggested Answer

Optimizing flow : duration and deleting SharePoint List items

(0) ShareShare
ReportReport
Posted on by 62
Hello everyone,
 
What are my problems :
Optimizing my flow so it does not take 3 days to complete.
Deleting all items from a SharePoint list at once (without having to do a "Get all items" > For each item > delete)

What is my flow about :
Once a month, I have to retrieve all the Planner tasks of 100+ groups into a SharePoint list to feed a Power BI report.
 
My flow big steps :
  • Recurrence trigger
  • Initializing 10 variables
  • HTTP request to Office 365 Groups to get all groups which names begins by "ProjectXX-".
  • For each group > on 150 groups
    • get the corresponding line in a Excel file (that gets me lots of information)
    • get all the Planner plans and filter those to get only the planner called "Project XX"
    • Get all details of the Project XX plan
    • Set several variables (groupName, groupID, planName, planID, categories)
    • Get all the tasks of Project XX plan
    • For each task > approx 150 tasks per group
      • Get the SharePoint list Item with title equals the task ID
      • Condition : does it exist in the list ? Yes > Delete. No > Do nothing
      • Get task details
      • Set variables (categories, is it late, get assigned user displayname...)
      • Create the task in the SharePoint list
      • Reset 5 tasks variables
    • Reset 5 groups variables
  • Refresh Power BI data set.
Here are the screenshot of it (it is super long)
 
Unfortunately, that flow is taking 3 days and 5 hours (and still counting) to complete. We are in the 30 days limit, but still. I am wondering if I could make it last less.
 
What I tried :
I searched cutting my groups using pagination and child flows but unfortunately, I have to work on the default environment without any managed solutions. So child flows are out of the picture.
 
For example: I battled a lot but could not find a way to delete all items from a SharePoint list at once. You always have to do a "Get items" > For each item > Delete. Even using rest API I could not do it.
 
What you can help me with :

Do you have any idea how to :
  • Batch delete all the items of a List at once ? Without passing through a for each step ?
  • Optimize my flow's duration (less than 1 day ? is it possile or am i too hopeful ?)
 
Thanks a lot !
 
Categories:
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    12,978 Super User 2025 Season 2 on at
    I have not tied this but take a look at this Power Automate Flow to batch delete SharePoint List Items. It shows how to batch delete items from SharePoint list.

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard