Create a variable of JSON Expression type
- Open the process in which to create a variable of JSON Expression type.
-
On the Modeling bar, click
Variables.
The Variables page appears.
- On the Type list, select JSON Expression.
- Enter a Name and ID for the variable.
-
Click
Configure.
The JSON Expression Variable page appears.
-
To specify the source to use in the JSON variable,
consume a string variable in the
Source JSON box.
For example, use the following string variable: { "person" : { "name" : "John" , "age" : 25 , "city" : "New York" }, "company" : "kofax" }You can set the source variable of JSON Expression as output to an activity. You cannot delete a source JSON variable if it is in use in JSON Expression variable.
-
In the
Expression Text box,
enter the JSON string, such as
$.person.name, or
$['person']['age'].
At runtime, the data is retrieved as John or 25 respectively.
-
On the
Return Type of Extracted
Data list, select the return type of the JSON expression.
TotalAgility supports the following variable types:
-
Boolean
-
Byte
-
Currency
-
Date
-
Decimal
-
Double
-
Float
-
Long
-
Short
-
String
-
- Click OK.