I have the value of a lookup column, but I don't have the ID, I want to query items from SharePoint list using the lookup value. How do I achieve that in CAML?

  • Do you want to query multiple items by lookup value? Oct 26, 2014 at 9:13
  • its straight forward query. what you want to acheive? Oct 26, 2014 at 16:44
  • So I want to query multiple items by lookup value? How can i do it?
    – f_gulay
    Sep 28, 2017 at 15:46

1 Answer 1


Default lookup query uses the value instead of lookup Id

The typical query looks like

            <FieldRef Name='RefCountry'  />
            <Value Type='Lookup'>India</Value>

To query by ID you have o setup LookupId='TRUE' attribute of FieldRef element

<FieldRef Name='RefCountry' LookupId='TRUE' />


  • How would I achieve that with "IN" clause? e.g. this doesn't work: <View Scope="RecursiveAll"> <Query> <Where> <In> <FieldRef Name="FileRef" /> <Values> <Value Type="Lookup"><![CDATA[/sites/site1/Shared Documents/abc.png]]></Value> </Values> </In> </Where> </Query> <ViewFields> <FieldRef Name="ID" /> <FieldRef Name="FileRef" /> <FieldRef Name="Author" /> <FieldRef Name="Editor" /> </ViewFields> <RowLimit Paged="TRUE">100</RowLimit> </View>
    – michalh
    Feb 9, 2018 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.