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 / Moving Files to Matchi...
Power Automate
Answered

Moving Files to Matching Folders - Error

(0) ShareShare
ReportReport
Posted on by 25

Hey There,

 

I work for a homebuilder and we have to occasionally send out notices to different customers. I have to move the notices (U1,U2, etc.), into the corresponding folder. The Project Managers like to put the suffix " - sold" for some of the folders to help them keep track of things more.

 

I've created a flow that moves the files into the folders, but eventually I get an error saying the file to be moved is not found. I think there is something wrong with my LotFolders loop, but I'm not exactly sure what is wrong. I've included screenshots of the flow, as well as the example files I want to copy, and folders they need to go in below.

 

Thanks!

 

RyJack26_0-1665585540901.png

RyJack26_1-1665585728262.png

RyJack26_2-1665585749286.png

 

  • Verified answer
    MichaelAnnis Profile Picture
    5,727 Moderator on at

    Start with an Exit Loop after Move Files.  Your first file is going to move into 1, and then it's going to try to move into 10, because it is still looping through all the folders, but the file isn't there, because it already moved.  So you need to Exit the folder loop after the file gets moved (inside the IF).  Good luck!

  • RyJack26 Profile Picture
    25 on at

    Ah that was it!

     

    Thanks Michael

  • RyJack26 Profile Picture
    25 on at

    I've run into a secondary issue now.

     

    The notices for 2,8, and 9 get filed under 20,18, and 19 respectively. I thought it might be because they contain the same digit, but 5,6, and 7 are all filed correctly and not under 15,16, or 17.

     

    Is there a way to make it go through the Folders loop in ascending order?

  • RyJack26 Profile Picture
    25 on at

    Figured it out. I ended up splitting the destination folder names as well.

     

    RyJack26_0-1665596221888.png

     

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Yeah, so, if you want to get rid of that logic, you could use %DestinationFolder.Name%, so you don't have to parse out the name from %FolderSplit[7]%

     

    https://learn.microsoft.com/en-us/power-automate/desktop-flows/datatype-properties#folders

     

    MichaelAnnis_0-1665597939918.png

    Glad you were able to figure it out.  Best of luck!

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

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 389

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard