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 / Automate moving files ...
Power Automate
Unanswered

Automate moving files in SharePoint based on the file name

(0) ShareShare
ReportReport
Posted on by 3

I know this question has been asked in different ways but I can't seem to connect the dots for what I'm working on. Recently we started using teams. One of the things I was assigned to do is set up a channel for our managers to send their daily reports. The reports would then need to be filed in folders based on the area of responsibility associated with the report. 

 

So is it possible to have files moved to separate folders based on the name of the file? Example: 2nd Main or 2nd Refresh. If so will is it safe to assume each folder will require it's on flow?

 

Thank you for any assistance anyone is able to provide. I'm definitely out of my element. Somehow I've become the team IT guy because I figured out a few macros in excel. lol

Categories:
I have the same question (0)
  • efialttes Profile Picture
    14,756 on at

    Hi!

    "So is it possible to have files moved to separate folders..."?

    Were do the files come from? I mean, are they uploaded/created in the same source folder, and as soon as they are uploaded/createdyou need to move them to different folder, based on the name given?

     

    I am also assuming files are stored in Teams group related Sharepoint site, right?

    Hope this helps

  • Verified answer
    v-litu-msft Profile Picture
    on at

    Hi @NotJamez,

     

    Yes, you could use the Condition action to move the file if the filename contains the keywords, for example:

    If the filename contains keyword1, move it to Folder 1, or do nothing and perform the following condition to judge whether it contains keyword2, keyword3, etc.

    Annotation 2020-03-10 134146.png

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • NotJamez Profile Picture
    3 on at

    With only one condition it works great, but when I add the 2nd one I get the error below.

     

    Under Condition 2

    InvalidTemplate. Unable to process template language expressions for action 'Condition_2' at line '1' and column '2802': 'The template language function 'contains' expects its first argument 'collection' to be a dictionary (object), an array or a string. The provided value is of type 'Null'.'.

    Flow 1.PNG

     

    Flow 2.PNG

     

    Flow 3.PNG

     

     

     

  • efialttes Profile Picture
    14,756 on at

    Hi

     

    Please add a Terminate action block with Status 'Succeeded' just after 'Move File 2' inside the true branch of your first Condition.

    https://powerusers.microsoft.com/t5/General-Power-Automate/Can-I-do-quot-Terminate-quot-action-as-quot-Successed-quot/m-p/14428

     

    Thanks!

  • v-litu-msft Profile Picture
    on at

    Hi @NotJamez,

     

    It's weird, I test on my side but not have the same issue, how about using the string() function to convert the dynamic content and keywords into a string, or you could input the filename with extension in the left of the condition:

    Annotation 2020-03-11 150126.png

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • LSZC Profile Picture
    2 on at

    Hi,
    I have a same issue - I attached some screenshot, maybe this is something you can help with. As soon as I have 2 conditions, the second one never gets triggered.
    Best
    Laura

  • Johnson23 Profile Picture
    35 on at

    @v-litu-msft 

     

    I want to do this as well but i want the file (created in SharePoint) to be moved to the file name's corresponding employee file folder in same SharePoint. Could you please help with this?

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard