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 / Move file to a dynamic...
Power Automate
Unanswered

Move file to a dynamic folder based on file name

(0) ShareShare
ReportReport
Posted on by 6

Looking to create a Flow for a file management system to move a file in a specified Sharepoint folder to another Sharepoint folder with a name that has the final 6 digits matching the first 6 digits of the file name. All done within the same site. I would like the flow to run once a day. 

 

Example:

 

Drop Off Folder contains file with file name- "XYZ123 Document"

 

Move  "XYZ123 Document" to folder with FolderName "Client XYZ123" 

 

Completely new to this, looking for some guidance

 

Thanks

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Mack98 

     

    Please have a look at my tutorial video.

    https://www.youtube.com/watch?v=B9ZxAd9JVVo&t=25s

     

    I will get back to you later about what you need to do.

     

    Thanks

     

     

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Mack98 

     

    As promised here are the rough guide lines what you need to do. Here I am using a manual trigger.

     

    image.png

     

    Above the compose expression to get the filename is as follows:

     

    substring(outputs('Compose'),0,6)
     
    image.png
     
    Above Compose 3  action step constructs the file folder you want to move to. The output which I mapped under Compose 3 is from Compose 2 output. Then the next step Create File Folder Path Output is mapped using the compose above (Compose 3). Once the file is  moved I am deleting the file from the original directory. For the delete file step the Id I am using is from 'Get file metadata using path' Dynamic properties.
     
    Note: Above I am using Doc1 and Doc2 as my libraries. Change that accordingly.
     
    Hope it make sense. If you have any questions please let me know.
     
    Thanks
  • Mack98 Profile Picture
    6 on at

    Thank you for the response and detail!

     

    Perhaps I was not fully explaining my scenario in regards to where the file is to be moved to. The destination folders are already existing, therefore I do not want to create a new destination folder. I have 100 folders, each of which has a 6 digit account number at the end of the folder's name. Each file to be moved has a 6 digit account number at the start of the name that corresponds with one of those folders. I would like the flow to move the file to the correct folder (the one that matches the account number)

     

    I hope that clarifies things. Thank you so much

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Mack98 

     

    Thanks for your reply. Create File Path does take care of that. If folder don't exists then it will create automatically. I would say try the solution I provided and run the flow. Later you could decide what to change or not?

  • Mack98 Profile Picture
    6 on at

    Thank you very much!

     

    Screen Shot 2021-01-26 at 12.57.24 PM.png

    Screen Shot 2021-01-26 at 12.57.40 PM.png

    This is my understanding of your solution applied to my situation... the Outputs you see correspond to the correct "Compose" sections in the same manner as yours. 

     

    Screen Shot 2021-01-26 at 12.58.43 PM.png

    This is the error I receive 

  • Bibi Profile Picture
    10 on at

    Hello @Mack98 , 

     

    I would like to know if you have managed to solve the error that is generated

     

    Thank you in advance

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard