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 / Using power automate t...
Power Automate
Unanswered

Using power automate to look for specific files in Sharepoint folder and move the files to another folder in Sharepoint

(1) ShareShare
ReportReport
Posted on by 6

I created a manual trigger of text to help the user to input the "specific name of the file" however I'm stuck as to how to connect the input to the existing data to search and move.

Categories:
I have the same question (0)
  • David- Profile Picture
    1,254 on at

    You can do this with the following steps:

    1. Get files (properties only) action with a filter query
      1. Use the query FileLeafRef eq 'filename.ext'
    2. Use a compose action to check that it found files with the expression length(outputs('Get_files_(properties_only)')?['body/value'])
    3. Follow with a condition where the output of the above Compose action is greater than or equal to 1
    4. If yes, use an Apply to each action with the Value of the Get files action. If no, you can end your flow.
    5. Add a Move file action in the Apply to each and set the File to Move field with the Identifier value from Get files and specify where you want it to move the files it finds. 
    6. Since you says you want to find "all" files with a specific name, be sure to choose Move with a new name in the If another file is already there field.

    Your flow will look like this:

    Web capture_10-9-2022_14147_make.powerautomate.com.jpeg

  • Ac2022 Profile Picture
    6 on at

    Hi,

     

    Thank you for your contribution @David- it is greatly appreciated.

     

    I followed the steps and I am got an error in the condition when I put the greater than, just re-read the document and realised my error was putting greater than instead of greater than or 1. Trail and error it's a beautiful thing.

    Ac2022_0-1662902649521.png

     

    It ran successfully however there was no result in the folder, would this work if input for the search is idfoldername e.g.(AA005 ABC)?

  • David- Profile Picture
    1,254 on at

    The filter just searches for files with the extensions. I am sure you can probably search for folders, but I don't know what value you would use as it is not something I have needed yet.

     

    Are you sure the file you are searching for exists? As long as you don't have anything in the "Limit Entries to Folder" it should search your entire document library. If you can take a screen shot of how you set up the condition and show the expression you used, I may be able to see something there.

  • jaanihsm Profile Picture
    300 on at

    Hi @David-!

     

    I tried your solution for a specific file that I need to search in my SP site. I entered a path to 'Limit Entries to Folder' and I changed the Condition, instead of 'is greater than or equal to', I used 'equal to'. The flow works if the file is not there but if it's there, the flow does not see it. What could be the issue? I must be missing something. Still new to Power Automate. Here is a screenshot of my flow. Thanks!

     

    jaanihsm_0-1710891401213.png

     

    jaanihsm_1-1710891644843.png

     

     

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