Constants and Calculated Values
These parameters provide a fixed value or calculate one from other parameters. The JSON examples show the complete parameter objects used in a copied workflow. Child parameters appear in the params array, in the same order as they appear in the editor.
Number
JSON type: math_expression. Expression: a number or mathematical expression. Result: a number, or a date, datetime, or timedelta when doing date arithmetic.
A static number or formula. You can use {} to input variable parameters into a formula. Click + Parameter to add new parameters. The order of the parameters matches up with the order of {} entered in the formula. For example, to convert a value from cents to dollars, your number formula would look like this: {} * 0.01.
Use {0} for the first child, {1} for the second, and so on when you want to use a child more than once or change the order. Repeated references to the same child use the same evaluated value. Do not put workflow variable names directly in the formula; add a Variable Selector as a child and reference its placeholder.
Supported operators are +, -, *, /, ** (power), and % (remainder). Parentheses control the order of operations. A leading minus sign is allowed. Functions are floor(value), ceil(value), round(value) or round(value, decimal_places), and abs(value). Rounding uses Python's rules: halfway values round toward the nearest even choice, and decimal fractions can be affected by floating-point precision. Other function calls, comparisons, //, and a leading plus sign are not supported.
Children must supply numbers, dates, datetimes, or timedeltas that make sense for the operation. Text is not automatically converted to a number; use Parse Number first. Missing placeholders, null operands, invalid formulas, and operations such as dividing by zero cause an error. Date and datetime arithmetic is described under Timedelta.
This example converts 1,250 cents to 12.5:
{
"type": "math_expression",
"expression": "{} * 0.01",
"params": [
{
"type": "math_expression",
"expression": "1250"
}
]
}A fixed number needs no children:
Parse Number
JSON type: parse_number. Expression: unused. Children: one value to convert. Result: a number.
Turn text into a number. Text containing a decimal point is parsed as a decimal number; text without a decimal point is parsed as an integer. Leading and trailing whitespace and a leading + or - are accepted. An existing number stays unchanged, and null becomes 0.
Blank text, commas, currency symbols, and invalid numeric text cause an error. For example, "12.50" works but "$12.50", "1,250", and "" do not. Scientific notation without a decimal point, such as "1e3", is not accepted; "1.0e3" is. This parameter does not evaluate a formula written as text.
This example returns 12.5:
Text
JSON type: template. Expression: text with optional placeholders. Result: a string.
A static string or a string with variable inputs. You can use {} to input variable parameters. Click + Parameter to add new parameters. The order of the parameters matches up with the order of {} entered in the string. For example, to insert someone's first name in a string, your text would look like this: Hello {}, Thank you for being a customer!
As with Number, {0} selects the first child, {1} selects the second, and an indexed placeholder can be repeated. {} advances through the children independently of any indexed placeholders, so using one style consistently is easier to read. Use {{ and }} to include literal braces. {name} is ordinary text, not a named variable reference. A placeholder for a missing child causes an error; unused children are flagged in the editor.
Text children are inserted as they are. Other values are converted to text: numbers become numeric text, booleans become true or false, null becomes null, and arrays and objects become JSON text. Null is not replaced with a blank string. Spaces and newlines in the expression are preserved. See Text Manipulation to change case, remove whitespace, or split text into lines.
This example returns Hello Sally, you have 25 points.:
An empty Text parameter returns an empty string:
Boolean
JSON type: boolean. Expression: BOOLEAN_IS_TRUE or BOOLEAN_IS_FALSE. Children: none. Result: true or false.
A fixed value of true or false. The JSON expression is one of the strings above, not the JSON values true and false, and not the strings "true" and "false".
This example returns true:
This example returns false:
Null
JSON type: make_null. Expression: unused. Children: none. Result: null.
A null value means no value. It is different from an empty string, zero, false, or an empty array. To test whether a value is null, use If with VALUE_IS_NULL or VALUE_IS_NOT_NULL.
Last updated
Was this helpful?

