How to you filter results within a Query List action by assigned to?

  • 31 January 2018
  • 3 replies
  • 11 views

Badge +3

I am trying to query a workflow task list by status and assigned to using the Query List action. The status part works fine however it just errors out on the assigned to part. Am I missing something obvious?

Here is the CAML query if that helps from the "Run now" option

<Query>
  <Lists>
    <List ID="{F8CF9D25-2E7B-4702-9E85-834450D992E8}" />
  </Lists>
  <ViewFields>
    <FieldRef Name="AssignedTo" />
    <FieldRef Name="WorkflowLink" />
    <FieldRef Name="Title" />
  </ViewFields>
  <Where>
    <And>
      <Eq>
        <FieldRef Name="Status"  />
        <Value Type="Choice">in progress</Value>
      </Eq>
      <Eq>
        <FieldRef Name="AssignedTo" LookupId="TRUE" />
        <Value Type="User">Steve</Value>
      </Eq>
    </And>
  </Where>
</Query>


3 replies

Userlevel 5
Badge +13

Try setting LookupId="FALSE" or removing LookupId="TRUE".  Give those a try and see if that works.

Badge +3

That did it! I would have never of thought to change that. Thank you!

Userlevel 5
Badge +14

if you specify LookupId="TRUE" then you have to supply sharepoint's user ID in the value field

213157_pastedImage_2.png

if you specify LookupId="FALSE" then you have to supply user's display name in the value field

213156_pastedImage_1.png

Reply