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. Commented Mar 29, 2016 at 13:09
  • How do you mean? Commented 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'>

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.