Share via


Expr Element (View)

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

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

<Expr>
</Expr>

Attributes

Attribute

Description

None

N/A

Child Elements

Numerous

Parent Elements

FieldSwitch, Switch

Occurrences

Minimum: 0

Maximum: 1

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

Reference

Expr1 Element (View)

Expr2 Element (View)