2

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. Mar 29, 2016 at 13:09
  • How do you mean?
    – bitwise
    Mar 29, 2016 at 14:21

1 Answer 1

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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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