Instead of below query, is possible to write dynamic CAML query for below CAML query. because below query will not work for dynamic data:
<Where>
<Or>
<Or>
<Eq>
<FieldRef Name='VehicleLine' />
<Value Type='Text'>Test1</Value>
</Eq>
</Or>
<Or>
<Eq>
<FieldRef Name='VehicleLine' />
<Value Type='Text'>Test2</Value>
</Eq>
</Or>
<Or>
<Eq>
<FieldRef Name='VehicleLine' />
<Value Type='Text'>Test3</Value>
</Eq>
</Or>
</Or>
</Where>
I cannot find a close example for what I am trying to achieve, which is to check multiple fields for multiple values. Yes, I have looked on SO already for my answer, including this one: Need help on building dynamic CAML Query.
With that said, if it is possible, how can the following SQL-like query be written in CAML?
DECLARE @VehicleLines VARCHAR(50)='Test1','Test2','Test3'; --it can anything (based on user selection)
SELECT * FROM Master WHERE VehicleLine IN (@VehicleLines)
I want to use CAML query in javascript to fetch data from list.