Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CAML Query for lookup field with multi values

What is the caml query for a Lookup field with multi values?

So far, I am using the following without success (it just throws an error). My Lookup column is:

Lookup
-------
2;3
2
3;4

<Contains><FieldRef Name="LookupColumn"/><Value Type="LookupMulti">2</Value></Contains>

What is wrong with that query??

like image 514
coffeeak Avatar asked Nov 16 '25 19:11

coffeeak


1 Answers

SPQuery oQuery = new SPQuery();
oQuery.Query = "<Where><Eq><FieldRef Name=\"LookupColumn\" LookupId=\"TRUE\"/><Value Type=\"LookupMulti\">2</Value></Eq></Where>";
like image 173
M.P. Avatar answered Nov 19 '25 10:11

M.P.