1

I'm trying to query a document list from a SharePoint Online server using REST API.

I have to use CAML, otherwise filtering is not possible on the taxonomy field as far as I know.

Below is the request I send to sharepoint, it returns the rows, but the columns FileRef, FSObjType, EncodedAbsUtl, FileLeafRef are missing from the result set.

/_api/web/lists/GetByTitle('docstore')/GetItems(query=@v1)?@v1=
{ 
"ViewXml": "<View Scope='RecursiveAll'>
            <ViewFields>
              <FieldRef Name='FileLeafRef'/>
              <FieldRef Name='FileRef'/>
              <FieldRef Name='FSObjType'/>
              <FieldRef Name='EncodedAbsUrl'/>
            </ViewFields>
            <Query>
              <Where>
                <Eq>
                  <FieldRef Name='ma7b4d79a8904f3685c6d9fe04f38d1d'/>
                  <Value Type='TaxonomyFieldType'>TaxName|b6e32b49-9e02-4f65-98dc-3a6049eb03c3</Value>
                </Eq>
              </Where>
            </Query>
          </View>"
}
2
  • I believe you are supposed to pass the Name of your List columns there. – Ramana Viswanadha Mar 29 '16 at 13:09
  • How do you mean? – bitwise Mar 29 '16 at 14:21
0

You'll need to explicitly load the columns (e.g., FileRef):

/_api/web/lists/GetByTitle('docstore')/GetItems(query=@v1)?**$select=FileRef&**@v1=
{ 
"ViewXml": "<View Scope='RecursiveAll'>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.