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

Hi @mvatcher,

 

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

Capture.PNG

 

Best regards,

Alice

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


@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

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Kudoed Authors
Users online (12,870)