Modifiers
Modifiers allow you to transform your Input Variables directly within your schema. This functionality uses a syntax inspired by Shopify's Liquid.
While not all Modifiers are implemented yet, the following are currently supported:
date
: Format a date string.replace
: Replace all occurrences of a substring.replace_first
: Replace the first occurrence of a substring.replaceRegex
: Replace using a regular expression.reverse
: Reverse an array.join
: Join an array into a string.uppercase
: Convert text to uppercase.lowercase
: Convert text to lowercase.capitalize
: Capitalize the first letter of the text.camelcase
: Convert text to camelCase.
Modifiers are applied by appending a pipe |
followed by the Modifier name and any required arguments.
By leveraging these Modifiers, you can simplify your workflows and reduce the need for additional processing steps in your Flows.
Example use of Input Variables in a JSON body::
{
// Formatting a date
"new_date": "{$input.date | date: '%a, %b %d, %y'}",
// Text transformations
"to_uppercase": "{$input.text | uppercase}",
"to_lowercase": "{$input.text | lowercase}",
"capitalize": "{$input.text | capitalize}",
"camelcase": "{$input.text | camelcase}",
// Array transformations
"reversed": "{$input.array | reverse}",
"joined": "{$input.array | join: ', '}",
// String replacements
"replaceRegx": "{$input.text | replaceRegx: '[a-z]', '*'}",
"replace": "{$input.text | replace: 'world', 'superflow'}",
"replace_first": "{$input.text | replace_first: 'world', 'superflow'}"
}