Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

GetListItems CAML query using Lookup fields

$
0
0

Hi,

I am struggling to find the correct CAML query syntax to use for GetListItems where I need to return an item ID based on a query involving both a lookup field (lookup is to a column within the same list) and a text field.

For Example (but changing one of the below to a lookup field):-

<soap:Body>
    <m:GetListItems>
      <m:listName>ListName</m:listName>
      <m:query>

<Query>
  <Where>
    <And>
      <Eq>
        <FieldRef Name="LevelOne" />
        <Value Type="Text">"test1"</Value>
      </Eq>
      <Eq>
        <FieldRef Name="LevelTwo' />
        <Value Type="Text">"test2"</Value>
      </Eq>
    </And>
  </Where>
</Query>

</m:query>

<m:viewFields>

<FieldRef Name ="ID" />

</ViewFields>

</m:viewFields>

</m:GetListItems>
</soap:Body>

Any help appreciated!


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>