Notifications
Announcements
Hi all, perhaps I'm missing something very obvious but here it goes:
I have a file here on this demo site:
Important to note that the name of the document is in the column 'Name' and the column 'Title' is a seperate column that is empty.
I want to retrieve this file by it's name (Kwaliteitshandboek VitaFlora Zorgt).
which results in this error:
So I'm puzzled as to how to retrieve this specific document using the document's name.
If I run the Get Files without an oData query I can view the JSON data which shows me this:
I have removed alot of irrelevant things (headers, thumbnails and identifying information) from this JSON to keep it shorter
{ "statusCode": 200, "headers": { "Cache-Control": "max-age=0, private" }, "body": { "value": [ { "@odata.etag": "\"4\"", "ItemInternalId": "2", "ID": 2, "Modified": "2024-03-27T15:32:36Z", "Editor": { "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", "Claims": "i:0#.f|membership|su", "DisplayName": "su", "Email": "su", "Picture": "https://.sharepoint.com/sites/VitaFlora/_layouts/15/UserPhoto.aspx?Size=L&AccountName=su", "Department": "", "JobTitle": "" }, "Editor#Claims": "i:0#.f|membership|su", "Created": "2024-03-27T15:14:46Z", "Author": { "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", "Claims": "i:0#.f|membership|su", "DisplayName": "su", "Email": "su", "Picture": "https://.sharepoint.com/sites/VitaFlora/_layouts/15/UserPhoto.aspx?Size=L&AccountName=su", "Department": null, "JobTitle": null }, "Author#Claims": "i:0#.f|membership|su", "OData__DisplayName": "", "{Identifier}": "Gedeelde%2bdocumenten%252fPublicaties%252fKwaliteitshandboek%2bVitaFlora%2bZorgt.pdf", "{IsFolder}": false, "{Thumbnail}": { "Large": "h6" }, "{Link}": "https:// .sharepoint.com/sites/VitaFlora/Gedeelde%20documenten/Publicaties/Kwaliteitshandboek%20VitaFlora%20Zorgt.pdf", "{Name}": "Kwaliteitshandboek VitaFlora Zorgt", "{FilenameWithExtension}": "Kwaliteitshandboek VitaFlora Zorgt.pdf", "{Path}": "Gedeelde documenten/Publicaties/", "{FullPath}": "Gedeelde documenten/Publicaties/Kwaliteitshandboek VitaFlora Zorgt.pdf", "{IsCheckedOut}": false, "{VersionNumber}": "3.0" } ] } }
Which contains most importantly:
And ofcourse I also tried query with {Name} eq 'Kwaliteitshandboek VitaFlora Zorgt' but then the query is invalid.
What am I overlooking here?
Thanks in advance.
Hi @the_dude,
Try the internal names of those system type fields.
https://blog.softartisans.com/2009/12/08/list-of-internal-names-for-sharepoint-fields/
In this case try to use FileLeafRef.
Try the below as a Filter Query if you want to match the exact name of the file (including file extension)
FileLeafRef eq 'Kwaliteitshandboek VitaFlora Zorgt.pdf'
Or if you want to match it partially try:
startswith(FileLeafRef, 'Kwaliteitshandboek VitaFlora Zorgt')
Thanks, that was the trick. at least it was not something incredibly obvious I was overlooking but rather something incredibly obscure that you wonder how the .... does anyone figure this out?
Yeah, I agree. Hard to figure this out. That's why I am sharing.
I just know this from experience. I have been working with SharePoint for the last 17 years and it always has been FileLeafRef in all versions of SharePoint I worked with. That's why I can remember what the internal of this column is 😁
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Michael E. Gernaey 523 Super User 2025 Season 2
Tomac 406 Moderator
abm abm 245 Most Valuable Professional