AnsweredAssumed Answered

CAML Query on ServerUrl breaks

Question asked by dgoodridge on Feb 9, 2016
Latest reply on Feb 10, 2016 by dgoodridge

I wrote a CAML query in a Query List action yesterday and got it working with a little help from SP CAML Query Helper 2013. It's pretty simple, get me the documents' ID in a Document Set in another list.

 

<Query>

  <Lists>

    <List ID="{7AE4B306-6F54-4A18-A91E-AB97B7F63EF4}" />

  </Lists>

  <ViewFields>

    <FieldRef Name="ID" />

  </ViewFields>

  <Where>

    <Contains>

      <FieldRef Name="ServerUrl"  />

      <Value Type="Computed">AgendaDocs/{ItemProperty:Meeting} - Agenda {ItemProperty:ID}/</Value>

    </Contains>

  </Where>

  <ViewAttributes Scope="Recursive" />

</Query>

 

Well, today I copied this query into another WF's Query List action, but I included a note at the bottom of the query, and thus received an error "Failed to query list data. Data at the root level is invalid. Line 17, position 1.".

 

The problem I'm having, is that since I created this error the query is no longer returning any results when I use it in either workflow, or even on the server using SP CAML Helper... It only returns results if I give it an incomplete name, for example:

 

<Value Type="lookup">AgendaDocs/Planning and External Relations - February, 2016</Value>

returns the document set and the documents contained within, but when I complete the DocSet Name

 

<Value Type="lookup">AgendaDocs/Planning and External Relations - February, 2016 8</Value>

the query breaks, returning zero results, not even the DocSet itself!

 

Before I send a bad request today, the entire query

<Value Type="lookup">AgendaDocs/Planning and External Relations - February, 2016 8/</Value>

would return just the items within the DocSet - which is what I'm trying to retrieve!

 

What did I do wrong? What did I break and how can I fix it?

Outcomes