When creating a statement, you may provide an expression as value for an argument in the statement.
For example, the following statement prints "Hello world, John!" if the parameter "first name" is John.
Similarly, the statement below verifies the text in the Price to be equal to the sum of "price" and "tax", where both price and tax are parameters.
Choosing Expression as input type
When the argument value is in "literal" mode, click on the icon in the right side of the input field as shown below.
This will bring the expression editor in the sidebar as shown. Four different types of expressions are supported - Freeform text expression, JSON expression, XML expression, and Numeric expression.
Free-form text: You can build an expression as a combination of literal text and various types of parameters.
Numeric Expression: Build an expression that performs numeric operations. You may not include text literals here.
JSON Expression: Create a JSON file as an expression, by parameterizing various parts of the file.
XML Expression: Create an XML file as an expression, by parameterizing various parts of the file.
Using Parameters in the Expression
To use a parameter in the expression, start typing "{{$". The expression editor presents a list of available parameters to choose from. These include Global Properties, Action Parameters and Local Parameters in the Action.
Note: When using a parameter as a JSON attribute value, do not include double quotes around the parameter name. See the example below:
Outline mode for editing JSON and XML
When working with JSON and XML, you can view and edit the content in Outline mode. This is convenient in many situations:
- Focused review of content by expanding/collapsing nodes
- Find JSON or XML path of a node
- Ability to set data types such as String, Boolean, Number, Null etc. for JSON content
Comments
0 comments
Please sign in to leave a comment.