Query List with AND condition (e. g. filtering by content type and URL) does not work


Badge +1

Hallo dear community,

 

I am struggling with the following situation:

I have a library with a workflow triggered by uploading of a document (create event).

In this workflow I get the URL of the item (checked log: works!)

I truncate this URL via /[^/]*$ pattern to get the URL of the parent folder (checked log: works!)

Now I use query list on same library to find another document in same folder and extract it's ID or name or any other property: for this I use it's content type (Auftragsvorlage) AND the encoded absolute URL of the parent folder (variable sltParentURL) via "contains" or "begins with " condition.

Unfortunately I don't get any results, whatever I try - if I remove the URL condition, the query gives me correct results in form of all available documents of that content type throughout the library. But it does not let me filter that down to the one in the folder with known URL.

In following the CAML query - can someone hint me at what I am doing wrong here? I tried so many things and somehow suspect that maybe the syntax of the URL is wrong here - my workflow gives me the URL as follows: 

Item Url: http.../AUT%2022-001/2.pdf

Parent Url after truncation: http.../AUT%2022-001 

 

<Query>
<Lists>
<List ID="{3AF695DA-41CB-4850-8E8F-037FC5DA46DF}" />
</Lists>
<ViewFields>
<FieldRef Name="ID" />
</ViewFields>
<Where>
<And>
<Eq>
<FieldRef Name="ContentType" />
<Value Type="Computed">Auftragsvorlage</Value>
</Eq>
<BeginsWith>
<FieldRef Name="EncodedAbsUrl" />
<Value Type="Computed">{WorkflowVariable:sltParentURL}</Value>
</BeginsWith>
</And>
</Where>
<ViewAttributes Scope="RecursiveAll" />
</Query>

 

Thanks a lot!
 

P. S: since I have very limited experience with CAML Query, I put it together in Nintex and then just switched to CAML Editor adding "ALL" to recursive. 


0 replies

Be the first to reply!

Reply