Appendix - CAML Query Information

This lesson provides some helpful introductory information for working with CAML Query. EPM Live uses CAML Query for certain tools within the solution. Additional resources for using CAML Query are available from Microsoft.

1. CAML Query Tips

The structure of a simple CAML query is defined as follows:

<[Operator]>

<FieldRef Name=’[FieldTitle]‘/><Value Type=’[FieldType]‘>[Value]</Value>

</[Operator]>

You can replace the [Operator] placeholder with one of the following operators:

  • Eq = equal to
  • Neq = not equal to
  • BeginsWith = begins with
  • Contains = contains
  • Lt = less than
  • Leq = less than or equal to
  • Gt = greater than
  • Geq = greater than or equal to
  • IsNull = is null
  • IsNotNull = is not null

Possible values that can replace [FieldType] are Boolean, Choice, Currency, DateTime, GuID, Integer, Lookup, Note, Text, User.

You can also define a query that contains multiple OR/AND conditions. Here is how you can define a query with two OR conditions, to select all items whose Name field is equal to either “Tony” or “John.”

<Or>

<Eq><FieldRef Name=’Name’/><Value Type=’Text’>Tony</Value></Eq>

<Eq><FieldRef Name=’Name’/><Value Type=’Text’>John</Value></Eq>

</Or>

A limitation of the <Or> and <And> blocks is that they can contain just two conditions. If you want to have more, you have to define an <Or> / <And> section that contains an inner <Or> / <And> section in place of one of the two conditions. The following examples show how to add a further possible value for the previously described query.

<Or>

<Eq><FieldRef Name=’Name’/><Value Type=’Text’>Tony</Value></Eq>

<Or>

<Eq><FieldRef Name=’Name’/><Value Type=’Text’>John</Value></Eq>

<Eq><FieldRef Name=’Name’/><Value Type=’Text’>Mary</Value></Eq>

</Or>

</Or>

Once you have built the CAML and saved the column, the WorkEngine Timer settings will automatically calculate the column values at the specified time.

Comments

0 comments

Please sign in to leave a comment.