arc:check

Version 24.2.8965


arc:check


Use the arc:check keyword with or without a value parameter. Without a value parameter, it ensures that an attribute is present in an item and that it is not a null string before the body of arc:check is executed.

If you specify a value parameter, the arc:check body executes only if the expression evaluates to true. Other values are considered false. The evaluation is case-insensitive.

Like other simple conditionals in ArcScript, arc:check can be paired with an arc:else keyword.

Note: Unlike arc:equals, arc:check does not throw an exception if the attribute does not exist in the item.

Parameters

  • item: The item in which to check the attribute. Specifying an item is not required. If no item is specified, the default output item is used.
  • attr: The name of the attribute to check. This parameter is required.
  • value: An expression that evaluates to true or false. For example, the result of a formatter that returns true or false.
  • action: The action to execute if the expression evaluates to true. Allowed values are break and continue.

Control Attributes

None

Example

Check whether an attribute is set before using it:

<arc:check attr="_input.In_Stock">
...
</arc:check>

See Also