Feb 22 2021 11:58 AM - edited Feb 23 2021 12:00 AM
I have a CAML query that I am running through the REST api, the simple example below requests 2 fields - FileLeafRef and CustomField. Custom field is simple a text field, nothing special.
CustomField is returned whereas FileLeafRef is not.
If I run the same CAML via CSOM or the old WCF/soap based services then FileLeafRef is returned...
<View Scope="RecursiveAll">
<Query>
<Where>
<Eq>
<FieldRef Name="FileRef" />
<Value Type="Text">/SomeSite/SomeDocumentLibrary/SomeFile.txt</Value>
</Eq>
</Where>
</Query>
<RowLimit>1</RowLimit>
<ViewFields>
<FieldRef Name="FileLeafRef" />
<FieldRef Name="CustomField" />
</ViewFields>
</View>
I know I can use a $select querystring, but this is on an app that the user can specify any number of columns to retrieve and querystrings have a limit.
So is there something I am missing? Or does REST CAML act differently to the other two...
N.b this is against SharePoint Online
I should add this is being called via a post to an endpoint like https://tenant.sharepoint.com/SomeSite/_api/web/lists(guid'listGuid')/getitems
Jan 11 2022 05:23 PM