Skip to content

Expression

The Expression widget displays a label whose content is dynamically generated using data templates. It also allows for updating the data model with calculated values.

The Content property specifies the template expression that determines the label's text. The calculated result of this expression is then stored in the data model element specified by the TargetXPath property.

XML Fields

  • Content contains the data template that is evaluated for the displayed result.
  • TargetXPath identifies the form-data element that receives that result. It is a child element, not an attribute.

Expression has no input field of its own. A change in data used by Content recalculates the displayed text and the value written to TargetXPath.

Example

The following example demonstrates how to create an expression that calculates a value based on three fields (Field1, Field2, Field3) from the data model and stores the result in a field named AllFields:

1
2
3
4
<Expression>
    <Content><![CDATA[{{Field1}} - {{Field2}} - {{Field3}}]]></Content>
    <TargetXPath><![CDATA[AllFields]]></TargetXPath>
</Expression>

This example assumes that Field1, Field2, and Field3 exist in the data model and contain values that can be concatenated using the - character. The resulting string will be stored in AllFields.