1

We are required to display the list data based on below 3 conditions for the based on 3 columns (Customer Category, Test Type ,Exercise Result) and sort with column (stage Plan) .

       1.  Customer Category : 0,1,1d,2,5

       2.  Test Type is equal to : "TableTop" (It is Choice Control)

       3.   Exercise Result is : Null or blank

       4.   And finally sort the list-view with Column "stage Plan".

Can any one help me how can I get the result based using CAML QUery

0

Haven't tested it, but should something like:

<Query>
   <Where>
      <And>
        <Eq><FieldRef Name='Test Type' /><Value Type='Text'>TableTop</Value></Eq>
         <And>
           <IsNull><FieldRef Name='Exercise Result' /></IsNull>
           <And>
              <Or>
                <Eq><FieldRef Name='Customer Category' /><Value Type='Text'>0</Value></Eq>
                  <Or>
                   <Eq><FieldRef Name='Customer Category' /><Value Type='Text'>1</Value></Eq>
                   <Or>
                     <Eq><FieldRef Name='Customer Category' /><Value Type='Text'>1d</Value></Eq>
                     <Or>
                       <Eq><FieldRef Name='Customer Category' /><Value Type='Text'>2</Value></Eq>
                       <Eq><FieldRef Name='Customer Category' /><Value Type='Text'>5</Value></Eq>
                    </Or>
                 </Or>
              </Or>
           </And>
         </And>
      </And>
   </Where>
   <OrderBy>
     <FieldRef Name='stage Plan' Ascending='TRUE' />
   </OrderBy>
</Query>

You can check the CAML builder: https://www.u2u.be/software

0

Update column names:

    <Query>
       <Where>
          <And>
            <Eq><FieldRef Name='Test Type' /><Value Type='Text'>TableTop</Value></Eq>
             <And>
               <IsNull><FieldRef Name='Exercise Result' /></IsNull>
               <And>
                   <In>
                      <FieldRef Name="Customer Category"/>
                      <Values>
                        <Value Type="Text">0</Value>
                        <Value Type="Text">1</Value>
                        <Value Type="Text">1d</Value>
                        <Value Type="Text">2</Value>
                        <Value Type="Text">5</Value>
                      </Values>
                    </In>
               </And>
             </And>
          </And>
       </Where>
       <OrderBy>
         <FieldRef Name='stage Plan' Ascending='TRUE' />
       </OrderBy>
    </Query>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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