cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

CAML Query on ServerUrl breaks

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?

Tags (2)
0 Kudos
Reply
1 Reply
Workflow Hero

Re: CAML Query on ServerUrl breaks

Doing more testing on this today to see if it's failing due to the length of the value I'm searching on. I created another Document Set with a short name, and a folder inside with a really long filename and a document within:

  1. sites/EMIS/AgendaDocs/Daniel's Test DocSet
    • -detects DocSet and all docs, no folder
  2. sites/EMIS/AgendaDocs/Daniel's Test DocSet/really long title lets stretch this out and see if it fails
    • -detects file in folder
  3. sites/EMIS/AgendaDocs/Daniel's Test DocSet/Con
    • -detects file in Docset
  4. sites/EMIS/AgendaDocs/This docset has a very long name - and - special characters 897 please fail
    • -works, docset and docs
  5. sites/EMIS/AgendaDocs/This docset has a very long name - and - special characters 897 please fail/
    • -just docs
  6. sites/EMIS/AgendaDocs/Business Management - March 2016
    • -Finds both DocSets for that month and all docs within
  7. sites/EMIS/AgendaDocs/Business Management - March 2016 - Agenda 18
    • -This query value fails as soon as I go one character beyond 'March 2016'

I've ruled out query value limitations, DocSet length limits, folder length limits...

I'm working around this by just querying the last part of the ServerUrl "Agenda XX/" , but this really bothers me that I don't know what's going wrong.

0 Kudos
Accept as Solution Reply