Define Variable Operator
This operator is in Beta.
The Define Variable operator allows you to create dynamic values to use in the workflow. This allows users to combine existing values with static strings to create a custom variable.
Define Variable supports Concatenate Strings, Substring, Trim, Replace, Get Index, Add Time, and Subtract Time operators.
Each defined variable can have a maximum of 50 operations. Operations are executed in sequential order starting with the initial value of variable A.
|Add a description for your custom variable.
|Add a unique name for the custom variable. Create variable names in camel case without spaces.
|A JSONPath expression to a string value or date in the step's input, to be acted on with the chosen operator.
|Select an operator to act on Variable A.
Choose an operator to act on Variable A. The operators you can use depend on the type of data selected for Variable A. Additional fields will appear based on your operator selection. The following operators are available:
|Adds a static string to a variable. You must enter a static string in the Variable B field to be added to Variable A.
|Takes the inner portion of a string from Variable A. Select the number of the first character you want to use in the Starts From field. Select the number of characters in the segment you want in the Length field.
|Trims whitespace from the beginning and ending of input strings. Select the Prefix checkbox to remove whitespace from the beginning of the string. Select the Postfix checkbox to remove whitespace from the end of the string. You can select both.
|Finds patterns of characters and replaces them with alternate values. Enter the character patterns you want to find in the Pattern field. Enter the desired alternate values in the Replacement field.
|Finds the location of a specific substring. Enter the substring into the Pattern field.
|Adds a selected amount of time to Variable A when Variable A is a date. Select a number in the Length field. This is the number of your selected units. In the Unit field, select from Seconds, Minutes, Hours, Days, or Months. The transformed date cannot be more than a year from the original date.
|Subtracts a selected amount of time to Variable A when Variable A is a date. Select a number in the Length field. This is the number of your selected units. In the Unit field, select from Seconds, Minutes, Hours, Days, Months, or Years. The transformed date cannot be before the current date.
If you configure a second custom variable called
Email Address, you might make the following configurations:
- Variable A is a JSONPath expression to a
firstnameattribute on an identity.
- Operator 1 equals
- Starts From equals
- Length equals
- Operator 2 equals
- Variable B is a JSONPath expression to a
.lastnameattribute on an identity.
- Operator 3 equals
- Variable B is the static value
The resulting custom variable will be
email@example.com and those attributes will be populated with the identity's data when the workflow is run.