I want to create CAML Query for following scenario,
(Metadata Name ="Author1" AND Value="Nitin Jagtap") AND (Metadata Name ="Program" AND Value="MBA")
.
I have tried but not able to create CAML query for same. I have used CAML Designer for same but unable to get proper result.
Following is the CAML Query which is generated by using CAML Designer but it is not giving results
<Where>
<And>
<And>
<And>
<Eq>
<FieldRef Name='Metadata_x0020_Name' />
<Value Type='Lookup'>Author 1</Value>
</Eq>
<Eq>
<FieldRef Name='Value' />
<Value Type='Text'>Nitin Jagtap</Value>
</Eq>
</And>
<Eq>
<FieldRef Name='Metadata_x0020_Name' />
<Value Type='Lookup'>Program</Value>
</Eq>
</And>
<Eq>
<FieldRef Name='Value' />
<Value Type='Text'>MBA</Value>
</Eq>
</And>
I have a list having name “Metadata Values” which contains two columns
- Metadata Name (which is a Lookup Column from Metadata List)
- Value (which is Single line of text column) The list “Metadata Values” contains multiple records for each Metadata Name having different- different values or same values.
How should I create proper CAML query, so it will gives proper results. Please guide me.
Value
equal bothMBA
andNitin Jagtap
. Should there be anOR
between the parentesis instead?