cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gangula
Level: Powered On

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.

2018-11-15_17-39-52.pngCopy files

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

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

6 REPLIES 6
Community Support Team
Community Support Team

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
Gangula
Level: Powered On

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. 

 

2018-11-16_18-48-42.pngCopy files from specific folder

 

 

 

 

 

 

 

BTbearings
Level: Powered On

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.

lk777
Level: Powered On

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

@BTbearings,
Top count: 5000
Do not trust that "(default=all)"
Divya
Level: Powered On

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!

BTbearings
Level: Powered On

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

That totally fixed it!!  Thanks!

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

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!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (5,886)