Skip to main content

Modifiers

Modifiers allow you to transform your Input Variables directly within your flow nodes and your schemas. 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.
  • prepend: Add text to the beginning of a string.
  • append: Add text to the end of a string.

Modifiers are applied by appending a pipe | followed by the Modifier name and any required arguments. Modifiers can be combined, by simply adding another one starting with a new pipe |. They are executed in the order of use.

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'}",

// String modifications
"prepend": "{$input.text | prepend: 'Hello'}",
"append": "{$input.text | append: 'world'}"
}