DataView, SharePoint 2013, SharePoint 2016

CAML Queries and DataForm Webparts

Background

Back before SharePoint Designer was free and became stripped down with the release of SharePoint Designer 2013, SharePoint Designer used to have a graphical user interface (GUI) for working with pages. This was super handy when you used it for modifying master pages and creating data form web parts. It made it easy to see how the page and/or web part would look prior to making it live. Now, with that feature being gone, you basically have to understand HTML, XML, XSLT, CAML, JavaScript, and CSS pretty well to follow the code to ensure your page won’t break because the code has an error. That lead to me using old working data form web parts and swapping out the CAML queries and form fields, as well as modifying the display portion of the web part using notepad or another code editing software. Being that I don’t perform this task too often, creating new data form web parts often, I needed to remember some terms and encoding that is crucial to the web part working. Hence, this post really is just to help me jog my memory on the correct “word” to use.

What to Remember About CAML Queries

Most often, you just need to ensure you are using the correct terms to get the results you are querying for. So when you find the SELECT statement, ensure you use these terms:
Eq
Neq
Or
Contains
BeginsWith
And
Note also: 
> is the greater than sign “>”
&lt; is the less than sign “<“
&amp; is the ampersand “&” 
You may also see encoding like the below:

x0020 which is a space found in some field names, similar to %20 for a space when encoding a URL