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

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Sharepoint: Moving a folder from Sharepoint to Sharepoint does not iterate through subfolders

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I'm monitoring a folder called "Outbox" via trigger: When a file is created or modified (properties only).

 

I want to copy folders into this "Outbox" folder. The copied folders may have subfolders.

 

If a upload from PC, or create the folders directly in Outbox folder it iterates through all subfolders,

but if a copy from another SharePoint path it only goes one level down (root of copied folder).

 

Example: 

I have a folder called:  Customer1, with sub1 and sub2, and files in the two subs.

Customer1 is located somewhere on Sharepoint.   I use the "copy to"  and select Outbox.

The trigger:  When a file is created or modified (properties only) runs.

The output is:   Customer1, sub1, sub2

So I'm missing the output of the files in the sub folder.

 

Thanks

I have the same question (0)
  • Unknown geen idee Profile Picture
    1,757 on at
    Re: Sharepoint: Moving a folder from Sharepoint to Sharepoint does not iterate through subfolders

    Dear F,

     

    Yes, that is how the action works, it only picks up the files/folders in that designated folder location, not any sub-folders.

    But you can resolve this by doing a filter array on the output of this action (which is likely a 'List files in folder' action or something similar). Use filter array with a condition 'IsFolder' to identify which items are a folder and then perform a 'List files in folder' or similar action on the identified folder ... then do the same and the same until you have retrieved all the details for the folder & subfolders.

    You can save all the results in a array variable ... and then use this variable to execute copy actions per path.

     

    It will look something like this:

    • Initialize array variable
    • 'List files in folder'
    • Append output to variable
    • Filter array on 'IsFolder'.
    • Apply to all
      • 'List files in folder'
      • Append output to variable
      • Filter array on 'IsFolder'.
      • Apply to all
        • 'List files in folder'
        • Append output to variable
        • Filter array on 'IsFolder'.

    You can automate this further by including a 'Do Until' condition ... anyway you should get the idea.

     

    Happy flowing,

    Koen

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 788 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 452 Moderator

#3
developerAJ Profile Picture

developerAJ 302

Last 30 days Overall leaderboard