I want to build a CAML - Query using the IN - Tag. The queried Column is a lookup-field to a Title of another list. When I query using the text-property everything works fine:
<Where>
<In>
<FieldRef Name='page' />
<Values>
<Value Type='Lookup'>page1</Value>
<Value Type='Lookup'>page2</Value>
<Value Type='Lookup'>page3</Value>
</Values>
</In>
</Where>
This is giving me the wanted result: All rows with Lookups to page1, page2 oder page3 are returned.
When I try to achieve this using the IDs instead I get no results at all:
<Where>
<In>
<FieldRef Name='page' LookupId='True' />
<Values>
<Value Type='Lookup'>5</Value>
<Value Type='Lookup'>4</Value>
<Value Type='Lookup'>3</Value>
</Values>
</In>
</Where>
I rechecked the IDs a dozen times. They are correct. When I change the query to multiple OR-Operations it works fine.
Is this a known limitation of SharePoint 2010 or do I just have to insert a "magic" word somewhere?
<Value Type='Integer'>5</Value>, – Arsalan Adam Khatri Oct 30 '12 at 13:28