cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Get File Properties from File Name

Hi all

 

I am trying to create a flow to query a Document Library and return just the files which contain the string 'T2FB' within the Name (File Name) field.  I have successfully created a Get files (properties only) with a query which returns all files that have the string 'T2FB' within the Title field, however when I change the field from Title to Name the flow fails saying that the column Name does not exist.  The issue I have is that not all files have the File Name in the Title field, my query returns only 8 files with the string 'T2FB' in the Title Field however if I run the same query without the filter and export to a csv file there are actually 83 files with the string 'T2FB' in the Name field.

Can someone confirm whether the ODATA Query "substringof" can be run against the Name field of a document library, or is there a workaround that I can use (eg run the query against all files, create an HTML table and filter this table against the Name value to generate the list)?  The purpose of this flow is to search several document libraries and copy all files with the data string in the file name into a single folder for action on a monthly basis, hence I need to return a set of results with the file ID for all files containing the string.

 

The substring query I am using that works successfully is:  substringof('T2FB', Title)

 

However when I change this query to:  substringof('T2FB', Name)

I get the error message "message""Column 'Name' does not exist. It may have been deleted by another user.\r\nclientRequestId: 7340d567-7467-485f-9448-25b666d30c0d\r\nserviceRequestId: e8dc8f9e-4080-7000-cb1c-f607fe9b6ed9"

 

I have tried putting the item Name in round, square and curly brackets (, [, { with and without single quotations and nothing is working.

 

Many thanks in advance!!

 

 

Matthew

 

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Get File Properties from File Name

Hi @mvatcher,

 

Please take a try to use the Filter Array action in your flow as screenshot below:

Capture.PNG

 

Best regards,

Alice

Highlighted
Frequent Visitor

Re: Get File Properties from File Name

Many thanks Alice, I have managed to filter the results using the array which aloows me to progress.

 

Do you know whehter the Name column can be Queried on for "substringof" in the Get files (properties) step to avoid returning all results and then filtering?

 

Thanks

 

Matthew

Highlighted
Advocate V
Advocate V

Re: Get File Properties from File Name


@mvatcher wrote:

 

Do you know whehter the Name column can be Queried on for "substringof" in the Get files (properties) step to avoid returning all results and then filtering?



 

Same question here! This work around should not be needed. How we can filter by file name with ODATA filter directly? Tried many things, but I don't get a clue why it is not working.

Highlighted
Frequent Visitor

Re: Get File Properties from File Name

Hi all,

 

I found this article recommending using 'FileLeafRef' rather than 'Name', and that seemed to work for me! That appears to be the SharePoint name for the 'Name' column. I hope this helps you as well!

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
Users online (5,918)