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

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
Community Support Team
Community Support Team

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

mvatcher
Level: Powered On

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

teqs
Level: Powered On

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

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

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow 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 Flow Community Video Gallery!

Users Online
Currently online: 54 members 4,806 guests
Please welcome our newest community members: