Filtering SharePoint lists using CAML query

CAML query is supported in BindTuning Web Parts to map data from SharePoint lists. You can create a query to target specific elements in a SharePoint list.

Creating a Query

If you’re using SharePoint 2013/2016 and Online, you can use a 3rd party free software for creating the query, like U2U Caml Query Builder for SharePoint 2013 (Standalone Edition).

The final CAML query will have a structure similar to the following:

<View> 
 <Query> 
  <Where> 
   <And>// have to meet this 2 conditions 
    <Eq> //Equal 
	<FieldRef Name='PromotedState' /> 
     <Value Type='Number'>2</Value> 
    </Eq> 
    <Leq> //Lower or Equal 
     <FieldRef Name="Created" />
     <Value Type="DateTime" Offset="-90"> // -90 days from today 
      <Today/> 
     </Value> 
    </Leq> 
   </And> 
  </Where> 
  <OrderBy> 
   <FieldRef Name='Created' Ascending='False'></FieldRef> // Most Recent to older created element
  </OrderBy> 
 </Query> 
 <RowLimit>3</RowLimit> // Number of items that you need to show 
</View>

Mapping SharePoint Column to the Web Part

Once the query is set, you can map SharePoint list column to certain Web Part caption zones, in order to retrieve data from those columns.

Write the column name in double brackets, every time you want to map a Web Part caption zone.

e.g. {{Title}}

Have more questions? Submit a request

Comments

Got a question?

If you can't find the answer to your question, you can contact us.
We are here and happy to help.

Powered by Zendesk