2.2.4.3 CamlContains

The CamlContains complex type specifies a filter based on a single field to restrict the data returned from a data-retrieval request.

 <s:complexType name="CamlContains">
   <s:sequence>
     <s:element name="Contains">
       <s:complexType>
         <s:sequence>
           <s:element name="FieldRef" >
             <s:complexType>
               <s:attribute name="Name" type="s:string" />
             </s:complexType>
           </s:element>
           <s:element name="Value" >
             <s:complexType mixed="true">
               <s:attribute name="Type" type="core:FieldInternalType" />
             </s:complexType>
           </s:element>
         </s:sequence>
       </s:complexType>
     </s:element>
   </s:sequence>
 </s:complexType>

FieldRef: Specifies which field to apply the filter to. The Name attribute MUST be set to the Name attribute of the field as specified in the response to a GetList request (section 3.1.4.15).

Value: Specifies the data type of the field to which to apply the filter, and its Type attribute matches the field type specified in the response from a GetList request. The filter to apply is a simple string that can be converted into the field type by the protocol server. For example, filtering the identification field for 200 would be specified as follows:

 <Contains>
   <FieldRef Name="ID">
     <Value Type="Counter">200</Value>
   </FieldRef>
 </Contains>

In a different example, filtering a text field named TextCol for the text "FindMe" would be specified as follows:

 <Contains>
   <FieldRef Name="TextCol">
     <Value Type="Text">FindMe</Value>
   </FieldRef>
 </Contains>