Skip to main content
improve format, add new tag
Source Link

I need to build a query a custom list with a user field. The where clause filters the results to a given list of user login names of a dynamic length, so I build the query according to the numbers of users. My

My problem is that executeQueryAsyncexecuteQueryAsync returns every item of the list, no matter how simple the where clause is.

Example for the simplest query:

<View><Query>
   <Where>
     <Eq>
       <FieldRef Name="UserName"/>
       <Value Type="User">domain\username</Value>
     </Eq>
   </Where>
</Query></View>

What could be wrong? Thanks for any hint!

I need to build a query a custom list with a user field. The where clause filters the results to a given list of user login names of a dynamic length, so I build the query according to the numbers of users. My problem is that executeQueryAsync returns every item of the list, no matter how simple the where clause is.

Example for the simplest query:

<View><Query>
   <Where>
     <Eq>
       <FieldRef Name="UserName"/>
       <Value Type="User">domain\username</Value>
     </Eq>
   </Where>
</Query></View>

What could be wrong? Thanks for any hint!

I need to build a query a custom list with a user field. The where clause filters the results to a given list of user login names of a dynamic length, so I build the query according to the numbers of users.

My problem is that executeQueryAsync returns every item of the list, no matter how simple the where clause is.

Example for the simplest query:

<View><Query>
   <Where>
     <Eq>
       <FieldRef Name="UserName"/>
       <Value Type="User">domain\username</Value>
     </Eq>
   </Where>
</Query></View>

What could be wrong?

Source Link
elsni
  • 471
  • 3
  • 8
  • 23

How to query a list's user field for a given login name in Javascript?

I need to build a query a custom list with a user field. The where clause filters the results to a given list of user login names of a dynamic length, so I build the query according to the numbers of users. My problem is that executeQueryAsync returns every item of the list, no matter how simple the where clause is.

Example for the simplest query:

<View><Query>
   <Where>
     <Eq>
       <FieldRef Name="UserName"/>
       <Value Type="User">domain\username</Value>
     </Eq>
   </Where>
</Query></View>

What could be wrong? Thanks for any hint!