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 Platform Community / Forums / Power Automate / Delete Folders, subfol...
Power Automate
Suggested Answer

Delete Folders, subfolders and files on MOVE into another library

(1) ShareShare
ReportReport
Posted on by 44
I have tried to do this repeatedly, but I am never able to delete fully all the content under the top/parent folder when I use the MOVE into a destination library.
I want the flow to start automatically on the destination library.
I have attempted this several times, but each time the flow just spins and I wait up to an hour and it never completes.
This is what I've done:  
Categories:
I have the same question (0)
  • Suggested answer
    11manish Profile Picture
    3,333 on at
    Don’t move full folders (causes infinite running)
     
    Use:
    • Copy + Delete OR
    • Move files one by one
    This ensures:
    • Reliable execution
    • Flow completes
    • Destination trigger works
  • Suggested answer
    Haque Profile Picture
    3,653 on at
    Hi @CU08031624-0,
     
    I would take the follwoing steps:
     
    1. Instead of moving entire folders at once, iterate through files and subfolders separately with controlled loops and smaller batches.
    2. Use Delay actions or limit concurrency in loops to avoid overwhelming SharePoint or hitting throttling.
    3. Copy + Delete: Copy files to the destination, then delete source files and folders explicitly. For more control and better error handling.
    4. After moving files, use SharePoint REST API calls or the "Delete file/folder" action to remove empty folders.
    5. Use separate flows for moving files and cleaning up folders, triggered sequentially or by events.
     
     
     
    The last point (number-5) is very important, to achieve this we can do the followings:

    Flow 1: Move Files and Subfolders: Triggered manually or by an event in the source library (e.g., "When an item is created" or scheduled). Responsible for moving all files and subfolders from the source folder to the destination folder. Consider handling iteration over files and subfolders with controlled concurrency and error handling.
     

    Flow 2: Delete Empty Source Folders: Triggered after Flow 1 completes (e.g., via a custom trigger like a status update, a queue item, or a scheduled run). This will recursively delete empty folders left behind in the source location.  We can use SharePoint REST API calls or "Delete folder" actions explicitly.

    Flow 3 (Optional): Process Files in Destination Library: Triggered automatically by "When a file is created" or "When an item is created" in the destination library. Responsible for any post-move processing or automation that should start once files arrive


    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard