Formatting Syntax
String formatting syntax is similar to Python. The application recognises both {} and ${}
notation. By default {} is used, but if ${ signature is found, ${} will be used for the entire
input.
A few simple examples:
template: {}
input: abc
result: abc
template: {} {}
input: abc
result: abc abc
template: =={}==
input: abc
result: ==abc==
template: {}${}{}
input: abc
result: {}abc{}
If you need to escape { when using {} replacements, use this combination: #{:
template: #{}
input: abc
result: {}
If you need to escape ${ when using ${} replacements, use this combination: \${:
template: \${}
input: abc
result: ${}
Object indexing
If input is not a string, but an object, you have to specify index of what you want to extract from it and use in the template. Objects on their own will produce empty strings:
template: {}
input: ["abc"]
result:
If input object is an array, you can index values using integers:
template: {0}
input: ["abc"]
result: abc
template: {1}-{0}
input: ["abc", "123"]
result: 123-abc
If input object is a map, you can index values using keys:
template: {abc}
input: {"abc": "123"}
result: 123
If input objects are more complex, you can use more complicated indexing mechanism:
template: {0.abc.e}
input: [{"abc": {"e": "123"}}]
result: 123
Simply use integers when indexing arrays and keys for maps, separate levels using dots.
Intrinsics
Formatting functionality supports a number of intrinsic functions that you can call in this way:
{#func()}
The arguments list () must be either empty when applying to a string, or use the same indexing
method as descibed above for objects.
For example, this applies to the entire input:
{#func()}
And this applies to the input object's subvalue:
{#func(abc.0)}
The list of supported functions is below.
escape
This function is used to escape input string using Percent Encoding.
template: {#escape()}
input: Do aliens exist?
result: Do%20aliens%20exist%3F
unescape
This function is a counterpart to escape and performs the reverse operation.
template: {#unescape()}
input: Do%20aliens%20exist%3F
result: Do aliens exist?
int
This function rounds input float value.
template: {#int()}
input: 1.723
result: 2
str
This function escapes formatting characters in a string making it safe for use as a part of another string.
template: {#str()}
input: This is
a "multiline"
'text' \n\t
result: This is\na \"multiline\"\n\'text\' \\n\\t
jsonEscape
This function escapes formatting characters in a JSON string, it works in the same way as str,
but doesn't escape single quotes.
template: {#jsonEscape()}
input: This is
a "multiline"
'text' \n\t
result: This is\na \"multiline\"\n'text' \\n\\t
date
This function converts date/time from ISO 8601 Date format to local system date and time string.
template: {#date()}
input: 2022-01-04T23:10:03
result: Tuesday, 4 January 2022 23:10:03