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 Platform Community / Forums / Power Automate / Moving Files to Folder...
Power Automate
Unanswered

Moving Files to Folders Listed in Excel

(0) ShareShare
ReportReport
Posted on by 33

Hi everyone

 

I have a table with 2 columns: File_name & Folder_location. The table consist of two rows:

 

"AAA" | "my_SharePoint/.../AAA"

"BBB" | "my_SharePoint/.../BBB"

... 

"ZZZ" | "my_SharePoint/.../ZZZ"

 

Then I have a SharePoint folder (folder_X) which contain 

files with name such as AAA_20221010, AAA_20221009, BBB_20221010, and so on. 

 

Is it possible to create a flow to automate moving files from folder_X to folders listed in the second column based on the file's name? (Triggered whenever a new file is created in folder_X) 

 

Thanks in advance

 

Categories:
I have the same question (0)
  • Verified answer
    Sundeep_Malik Profile Picture
    6,484 on at
    Re: Moving Files to Folders Listed in Excel

    Hey @MG_Prime 

    This is possible in power automate, but go ahead carefully and step by step. Below is the flow:

     

    Sundeep_Malik_0-1665423015433.png

     

    Expression: split(outputs('Get_file_metadata')?['body/Name'],'_')?[0]

     

    Split function converts string to an array. So the name of the file AAA_22, will now split into AAA and 22. So used 0 at the end to grab just AAA from there.

     

    After this you can use list rows in a table and in filter query give columnname eq 'Outputs of above compose'

     

    But make sure there is no space between the column name, filter query does not work if there is space between column name. If you have a space and can rename it, it will be better.

     

    Sundeep_Malik_1-1665423268449.png

     

     

    Or if you dont want to use filter query, then in the next step you can add a condition action and match the column to output of above compose.

     

    Sundeep_Malik_2-1665423317074.png

     

    And then in if yes just give the file destination from the second column.

  • MG_Prime Profile Picture
    33 on at
    Re: Moving Files to Folders Listed in Excel

    it works like a charm. lesson learned.

     

    thanks a lot, Mr Malik

     

    have a good day

    🙂

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

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard