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 / Automating Movement of...
Power Automate
Unanswered

Automating Movement of Folders

(0) ShareShare
ReportReport
Posted on by 10

Hello Power Automate Community!

 

I am trying to move folders in one folder to another folder in the same folder. 

 

I know that Power Automate has the "move folder" function but my situation is a bit more complicated than that. 

 

For example, the main folder will have folders entitled "130", "140", and "150". The main folder will constantly be receiving downloaded content as new folders and they will be called, for example "130_helloworld". This folder would need to automatically move to the parent folder of "130". Is there a way to ask Power Automate to scan all the folders in the parent folder (where folders "130", "140", and "150" are located) and then scan if there are any folder with the same name but have an underscore after it (e.g. 130_helloworld) and move it to folder "130". 

 

Thanks a lot and any help would be highly appreciated!

 

I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @postproduction 

    It is possible to do via power automate desktop

     

    see this flow screenshot 

     

    Nived_Nambiar_0-1624563228688.png

    Steps used 

     

    1. get all folders in directory and store in Folders variable

     

    2. Then use a for loop to loop through the folder under Folders variable

     

    3. inside the loop, done the following thing,

                 a.  Use If action to check whether the Name of folder contains _ (underscore)

                           

    Nived_Nambiar_1-1624563379873.png

     

     

         b. Inside the if block, done the following things

                   

    Nived_Nambiar_2-1624563434512.png

     

    Use Parse text to retrive the name of folder to which the folder to moved, for eg if the folder name is 130_hello, then i need to retive the name 130 which is the destination folder for this case. for to extract that text regular expression is used  \d+(?=_.*)     The result of this action is stored in root variable

     

    Next after the Parse text activity, used Move folder activity to move the folder to destination 

     

    see the screenshot 

    Nived_Nambiar_3-1624563633049.png

     

     

     

    Hope the information helps you

     

     

    Regards,

    Nived N

     

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @postproduction 

    did the above idea works for you ?

  • postproduction Profile Picture
    10 on at

    Hi Nived!

     

    Thanks a lot for your comprehensive response. 

     

    I have tried what you have instructed me to do but I am getting this error: 

     

    Robin.Core.ActionException: Destination folder Z:\TEST\0 doesn't exist.
    at Robin.Modules.Folder.Actions.MoveFolder.Execute(ActionContext context)
    at Robin.Runtime.Engine.ActionRunner.RunAction(String action, Dictionary`2 inputArguments, Dictionary`2 outputArguments, IActionStatement statement)

     

    I think it might be a problem with the variables that I am using and renaming. Do you know what I can do about this by any chance? 

     

    Please let me know if you need more info. 

     

    Best,

    Shant 

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi Shant,

    at what section/action you are getting error ?

  • postproduction Profile Picture
    10 on at

    Hi Nived, 

     

    I am getting an error at action 5 ... the move folder action. 

     

    postproduction_0-1624878081820.png

    Do you happen to know what I can do here? 

  • tkuehara Profile Picture
    667 on at

    Hi @postproduction 

     

    It seems you are using the wrong variable. You need to use the value captured from the parse action, not the position. Here's an example with the highlighted correct variable:

    tkuehara_0-1624913926437.png

    Your "Move folder" action would look something like this (feel free to change the default name "Match" to anything suitable to your case):

    tkuehara_1-1624914303503.png

     

  • postproduction Profile Picture
    10 on at

    Hi tkuehara,

     

    Thanks a lot for this information! It worked 🙂 

     

    Best,

    Shant 

  • tkuehara Profile Picture
    667 on at

    Hi @postproduction,

     

    My pleasure!

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 233

#2
David_MA Profile Picture

David_MA 217 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 190

Last 30 days Overall leaderboard