Expr Element

The Expr element contains a CAML expression that is evaluated to determine the course of action for a Switch statement. The expressions can be any set of CAML elements that render text, or they can be other conditionals.

Syntax

<Expr>
</Expr>
Parent Elements Child Elements
Switch Column, Column2, Field, GetFileExtension, GetVar, InheritsPermissions, InNavBar, ListProperty, LookupColumn, Property, Today, UserID

Example

The following example checks the value of a UserID field and returns "User Zero" if the value is 0 (zero). Otherwise, it sets a default value: "Not User Zero".

<Switch>
  <Expr><UserID/></Expr>
  <Case Value="0">User Zero</Case>
  <Default>Not User Zero</Default>
</Switch>

See Also

Expr1

Expr2