Forum Discussion
How to use MS FLow and ODATA to filter a document library on file name?
- May 01, 2019
Erik,
Instead of using name as the filter, try FileLeafRef -
I was able to return all files from this library whose names start with the letter H.
Hope this helps.
Terry McCullagh
It certainly helps!
Just out of curiosity - how did you figure this one out? From the SharePoint Search Schema?
Thank you!
Erik,
I've found the Odata Query Builder from Authur Graus to be extremely helpful in constructing the correct queries.
https://appsource.microsoft.com/en-us/product/office/WA104051159
This article is also helpful:
https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/use-odata-query-operations-in-sharepoint-rest-requests
Regards,
Terry
- Erik WettergrenMay 06, 2019Iron ContributorHi and thanks again! Great tip about the Query Builder and a useful article.
/Erik- Terry_McCullaghMay 08, 2019Brass ContributorErik - Glad to have been of assistance.
- eliotcole-projectfiveOct 11, 2019Brass Contributor
First of all, *thank you* for this solution, it's great ... and has saved me *hours*.
Secondly, I should say that I haven't come here to doubt anything. However, I noted that this stack notes that FileLeafRef is a bit ... flighty?
https://sharepoint.stackexchange.com/questions/241067/how-to-read-the-name-column-in-a-sharepoint-document-library
Is there a chance that this isn't the most reliable method, and we need to build a little logic scope to filter, as per Alice's ( @v-yuazh-msft ) answer in this question to be totally sure?:
https://powerusers.microsoft.com/t5/General-Flow-Discussion/Get-File-Properties-from-File-Name/td-p/157860