cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

Microsoft Flow: Get files (properties only) of file only in a specific folder

I'm trying to copy all the files in a folder(excluding the sub-folders) I have in SharePoint using the "Get files (properties only)" action. I tried to use the "Filter Array" action to filter out the list using the folder path. The filter array is working fine but I'm not able to use that in the Copy file Action. 

 

I have seen a similar question asked before, but that did not have a solution I'm looking for. It had a workaround, but I'm looking for a simpler solution.

Copy filesCopy files

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Microsoft Flow: Get files (properties only) of file only in a specific folder

Hi @Gangula,

 

I did a test on my side, and fields like {Path} seem to be invalid in Filter Query.

Using Filter array is a good choice, I have configured it based on what you provided.

In the condition of the Filter query, a judgment is added to check whether the item under this path is a folder. If it is a folder, it needs to be excluded.

Formula reference:

@and(equals(item()?['{Path}'], 'Copy/Test123/'),equals(item()?['{IsFolder}'], false))

Then use items(‘Apply_to_each’)[‘ {Identifier}’] in File to copy field to get the Id of the filtered files, then copy the file to the destination.

Image reference:

47.PNG

Please take a try.

 

Best Regards,

Barry

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

View solution in original post

7 REPLIES 7
Highlighted
Community Support
Community Support

Re: Microsoft Flow: Get files (properties only) of file only in a specific folder

Hi @Gangula,

 

I did a test on my side, and fields like {Path} seem to be invalid in Filter Query.

Using Filter array is a good choice, I have configured it based on what you provided.

In the condition of the Filter query, a judgment is added to check whether the item under this path is a folder. If it is a folder, it needs to be excluded.

Formula reference:

@and(equals(item()?['{Path}'], 'Copy/Test123/'),equals(item()?['{IsFolder}'], false))

Then use items(‘Apply_to_each’)[‘ {Identifier}’] in File to copy field to get the Id of the filtered files, then copy the file to the destination.

Image reference:

47.PNG

Please take a try.

 

Best Regards,

Barry

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

View solution in original post

Highlighted
Advocate II
Advocate II

Re: Microsoft Flow: Get files (properties only) of file only in a specific folder

@v-bacao-msft, Thank you for the reply. Based on your solution I found another way to solve the issue. 

 

Copy files from specific folderCopy files from specific folder

 

 

 

 

 

 

 

Highlighted
Advocate I
Advocate I

Re: Microsoft Flow: Get files (properties only) of file only in a specific folder

I have the same issue, but now I'm running up against the 100 item limit for the SharePoint Get files (properties only) action [edited to correct action name].  If I could filter the items directly in the Get files (properties only) action [edited to correct action name], then I would be fine.  But, if I can't filter by folder path until after the Get files (e.g. by using filter array), than I have no way around the 100 item limit.

 

If that isn't clear, imagine a big document library with 3000 or so files.  All the files are similar, but I want the 30 or so files in a particular folder.  If there is nothing else unique or identifying about these folders except for their folder path, how could I use flow to get those 30 files?  It seems impossible.

 

The only option I see is adding some sort of column to the library and seeing if that is filterable in the Get files (properties only) action [edited to correct action name], and use that like a key of some kind.

Highlighted
Helper II
Helper II

Re: Microsoft Flow: Get files (properties only) of file only in a specific folder

@BTbearings,
Top count: 5000
Do not trust that "(default=all)"
Highlighted
Regular Visitor

Re: Microsoft Flow: Get files (properties only) of file only in a specific folder

My flow stopped working because there were more than 100 files in the document library. Changing the top count to 5000 solved my problem!!! Thanks!! Have been trying to figure this out for hours!

Highlighted
Advocate I
Advocate I

Re: Microsoft Flow: Get files (properties only) of file only in a specific folder

That totally fixed it!!  Thanks!

Highlighted
Frequent Visitor

Re: Microsoft Flow: Get files (properties only) of file only in a specific folder

Exactly right.  Frustrating that it doesn't work as indicated and you have to find a post from @lk777 to figure it out!  Thanks!!

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (8,307)