Placeholders insert dynamic values into text, such as a field's value, details of the logged-in user, or today's date. They can be used anywhere a setting accepts placeholders, for example field defaults, file names, email templates and generated PDFs.
The easiest way to create a placeholder is with the Placeholder Builder. It lets you pick a value and add methods, and shows the resulting placeholder text.
How placeholders work
A placeholder is wrapped in double braces. Inside, it starts with a value and can be followed by one or more methods, each after a pipe (|):
{{value}}
{{value | method()}}
{{value | method1() | method2("argument")}}
-
Methods run from left to right. Each one receives the result of everything to its left.
-
Text arguments go in double quotes, for example
replace(" ", "-"). Numbers andtrue/falsedon't need quotes. -
An argument can itself be a placeholder value, for example
equals(fields["other_field"]). -
Pipes and commas inside quotes or parentheses are treated as part of the argument, not as separators.
-
Some methods, such as
addorcoalesce, can also be used on their own with all their values as arguments:{{add(fields["a"], fields["b"])}}.
For example, this takes a field's value, keeps the second item of a pipe-separated list, and removes surrounding spaces:
{{fields["field_id"] | split("|", 2) | trim()}}
Values
Every placeholder starts with one of these values.
Fields and metadata
|
Placeholder |
Description |
|---|---|
|
|
The value of a field. Inside a grid row, this refers to the field in the same row. |
|
|
The value of a metadata item. Commonly used in processing stages, where earlier stages may have updated the metadata. See also |
Current user
|
Placeholder |
Description |
|---|---|
|
|
Email address of the currently logged in user. |
|
|
User name of the currently logged in user. |
|
|
Display name of the currently logged in user. |
|
|
Id of the currently logged in user. |
|
|
Gets the value of the “department” user defined value that has been configured in Users | User Defined Values |
|
|
User name of the manager for the currently logged in user. |
|
|
Email address of the manager for the currently logged in user. |
|
|
Display name of the manager for the currently logged in user. |
|
|
Gets the value of the managers “department” user defined value that has been configured for the current user. |
Page
|
Placeholder |
Description |
|---|---|
|
|
Id of the page the current item or field is on. |
|
|
Name of the page. |
|
|
Type of the page, for example RIA or DFA. |
Indexing item
Available in the fields of Remote Indexing Assistant items.
|
Placeholder |
Description |
|---|---|
|
|
GUID of the item. |
|
|
Name of the item. |
|
|
Size of the item. |
|
|
GUID of the queue the item is in. |
|
|
Name of the queue. |
|
|
GUID of the queue type. |
|
|
Name of the queue type. |
Date and time
|
Placeholder |
Description |
Example |
|---|---|---|
|
|
The current server date, as |
|
|
|
The current server time, as |
|
|
|
The current server date and time. Use with |
|
Use format to change the output, for example {{date | format("{0:dd/MM/yyyy}")}} or {{time | format("{0:hh-mm-ss}")}}.
Text methods
|
Method |
Description |
Example |
Input |
Result |
|---|---|---|---|---|
|
|
Inserts the value into a .NET format string, where |
|
|
|
|
|
Converts to lower case. |
|
|
|
|
|
Converts to upper case. |
|
|
|
|
|
Capitalises the first letter of each word and lower-cases the rest. |
|
|
|
|
|
Capitalises the first letter of each sentence. Other letters are unchanged. |
|
|
|
|
|
Removes leading and trailing whitespace, including tabs and line breaks. |
|
|
|
|
|
Replaces all occurrences of the first text with the second. |
|
|
|
|
|
Splits on a separator and returns the item at the given position, starting at 1. |
|
|
|
|
|
Returns the given number of characters from the start. |
|
|
|
|
|
Returns the given number of characters from the end. |
|
|
|
|
|
Removes or converts types of characters. See SanitiseText. |
|
|
|
|
|
Returns the first of its arguments that has a value. |
|
a: empty
|
|
SanitiseText
Removes or converts types of characters, for example to clean up a value before using it in a file name or reference number.
{{fields["field_id"] | sanitiseText("type")}}
To apply several types, either list them or chain the method. Both give the same result, and types run in the order given:
{{fields["field_id"] | sanitiseText("alpha", "commas", "spaces")}}
{{fields["field_id"] | sanitiseText("alpha") | sanitiseText("commas") | sanitiseText("spaces")}}
The Placeholder Builder applies one type per method. To apply several types, add Sanitise Text once for each type.
Sanitisation types
Type names are not case-sensitive. A type that isn't recognised is ignored.
|
Type |
Builder option |
What it does |
||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Spaces |
Removes all whitespace, including spaces, tabs and line breaks. |
||||||||||||||||||||||||
|
|
Line Breaks |
Removes line breaks only. |
||||||||||||||||||||||||
|
|
Punctuation |
Removes punctuation, such as |
||||||||||||||||||||||||
|
|
Punctuation, ignore period |
Same as |
||||||||||||||||||||||||
|
|
period |
Removes full stops ( |
||||||||||||||||||||||||
|
|
Commas |
Removes commas ( |
||||||||||||||||||||||||
|
|
Quotes |
Removes double quotes ( |
||||||||||||||||||||||||
|
|
Symbols |
Removes symbols, such as |
||||||||||||||||||||||||
|
|
Alpha |
Removes letters. |
||||||||||||||||||||||||
|
|
Numeric |
Removes numbers. |
||||||||||||||||||||||||
|
|
Alpha/Numeric |
Removes letters and numbers, leaving only other characters. |
||||||||||||||||||||||||
|
|
Invalid file name characters |
Removes characters that aren't allowed in file names, such as |
||||||||||||||||||||||||
|
|
Convert to ASCII |
Converts text to plain ASCII, keeping as much information as possible. Unlike the other types, it converts characters where it can rather than deleting them:
|
Examples
|
Placeholder |
Input |
Result |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date methods
Date values must be read as a date before they can be formatted or used in date methods. Use format with a .NET date format to output them.
|
Method |
Description |
Example |
Input |
Result |
|---|---|---|---|---|
|
|
Reads the value as a date in the given format. |
|
|
|
|
|
Reads the value as a date using the server's locale, so the exact format doesn't need to be known. |
|
|
|
|
|
Returns the financial year a date falls in. See arguments. |
|
|
|
|
|
Returns the month number within the financial year. See arguments. |
|
|
|
Financial year arguments
asFinancialYear and asFinancialMonth take the same two arguments:
|
Argument |
Required |
What to enter |
Example |
|---|---|---|---|
|
First |
Yes |
The day the financial year starts, written as day/month. Always |
|
|
Second |
No |
How the field's date is written, so it can be read correctly. Leave it out if the date is in the server's normal format. |
|
|
Placeholder |
Field value |
Result |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If the date can't be read, the value is returned unchanged.
Number methods
add, subtract, multiply and divide can be used two ways:
-
On their own, with all values as arguments. The operation runs from the first value onwards:
{{subtract(fields["a"], fields["b"], "5")}}is a − b − 5. -
After a pipe, applying to the incoming value:
{{fields["a"] | subtract("5")}}is a − 5.
|
Method |
Example |
Input |
Result |
|---|---|---|---|
|
|
|
a: |
|
|
|
|
a: |
|
|
|
|
a: |
|
|
|
|
a: |
|
|
|
|
a: |
|
|
|
|
a: |
|
|
|
|
a: |
|
Comparisons and conditions
Comparison methods return true or false. Follow them with condition to output different text depending on the result:
{{fields["field_id"] | exists() | condition("Has a value", "Is empty")}}
|
Method |
Returns true when the value… |
Example |
Input |
Result |
|---|---|---|---|---|
|
|
is not empty, null or whitespace |
|
|
|
|
|
is the same as the argument |
|
|
|
|
|
starts with the argument |
|
|
|
|
|
ends with the argument |
|
|
|
|
|
contains the argument |
|
|
|
|
|
matches a regular expression |
|
|
|
|
|
is greater than the number |
|
|
|
|
|
is greater than or equal to the number |
|
|
|
|
|
is less than the number |
|
|
|
|
|
is less than or equal to the number |
|
|
|
|
|
Not a comparison: returns the first argument if the input is |
|
|
|
Handling missing values
Normally, if a method fails, for example split asks for a position that doesn't exist or a field has no value, the whole placeholder fails with an error. Add nullable() to return an empty string instead:
{{fields["field_id"] | nullable() | split("|", 4)}}
-
nullable()doesn't change the value. It only changes how failures are handled for the methods after it. -
It can go at the start, as in
{{nullable() | property("test") | trim()}}, or after the value. -
It only applies to the placeholder it's in. If text contains several placeholders, add
nullable()to each one that needs it. -
It's available in the Placeholder Builder as Nullable.
|
Placeholder |
Scenario |
Result |
|---|---|---|
|
|
|
empty |
|
|
|
|
|
|
Field |
empty |
|
|
Field |
Error: the second placeholder isn't nullable |
|
|
Field |
|
Collections
Some fields, such as check boxes and multi-selects, hold several values.
|
Method |
Description |
Example |
Input |
Result |
|---|---|---|---|---|
|
|
Joins the values with a separator. |
|
|
|
|
|
Returns the number of values. |
|
|
|
|
|
Combines several values into a collection, so collection methods such as |
|
a: |
|
Properties and attributes
Some values contain named parts rather than a single piece of text. Use these methods to pick out one part.
property
Returns a named part of an object value, such as the answer to one question in a Likert field or a value produced by kfiDeserialise. On a collection, it returns the item with that name.
{{fields["field_id"] | property("name")}}
If the value doesn't have named parts, it's returned unchanged.
attribute
Returns extra information recorded about a metadata value, rather than the value itself. For example, when processing extracts a value from a document, it records where the value came from and how confident the extraction was.
{{metadata["metadata_id"] | attribute("name")}}
|
Attribute |
Description |
|---|---|
|
|
Name of the configuration or stage that set the value. |
|
|
Type of the source that set the value. |
|
|
Type of extraction configuration used, where the value was identified from a document. |
|
|
Confidence score of the extracted value. |
|
|
Location of the value in the document, as JSON. |
Which attributes are available depends on what set the value. Use nullable() if an attribute might not be present:
{{metadata["invoice_total"] | nullable() | attribute("confidence") | greaterThanEquals(0.8) | condition("OK", "Check")}}
kfiDeserialise
Reads a value in the KFI lookup format, so that its parts can be used with property. Only the first record is used.
{{fields["lookup"] | kfiDeserialise() | property("name")}}
|
Format |
Meaning |
|---|---|
|
|
A named value. |
|
|
Separates named values. |
|
|
Separates records. |
|
|
Escapes the next character, so |
|
Placeholder |
Input |
Result |
|---|---|---|
|
|
|
|
Grids
Within a grid row, {{fields["field_id"]}} refers to the field in the same row. To use data from the whole grid, apply these methods to the grid field.
Reading values
|
Method |
Description |
Example |
|---|---|---|
|
|
The value of one cell. Rows start at 1. |
|
|
|
The number of rows. |
|
|
|
Joins the values in one column, for example |
|
|
|
The total of a column. Returns nothing if any value isn't a number. |
|
Outputting the whole grid
For the methods that take includeHeaders, pass true to include column names as the first row.
|
Method |
Example |
Output |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
||||||||||||
|
|
|
|
||||||||||||
|
|
|
|
||||||||||||
|
|
|
|
||||||||||||
The HTML methods are useful in emails and generated PDFs. They output a plain <table>; the examples above use this CSS, which you can add to your template:
<style>
table, th, td {
border: 1px solid;
padding: 12px 15px;
border-collapse: collapse;
}
</style>
Likert fields
A Likert field returns its whole results table:
{{fields["likert_field_id"]}}
To get the answer to one question, use property with the question id:
{{fields["likert_field_id"] | property("question_id")}}
Barcodes
Generates a barcode image as a Base64 encoded string.
{{barcode("value")}}
{{barcode("value", "type")}}
{{barcode("value", "type", "dpi")}}
|
Argument |
Description |
Default |
|---|---|---|
|
|
The text to encode. Can be a placeholder value, such as |
Required |
|
|
|
|
|
|
Resolution in dots per inch. |
|
To show the barcode in a generated PDF in indexing or forms, use it as an image source:
<img src="{{barcode(fields["barcode_value"], "QR")}}"/>
Worked examples
Show text only when a field has a value
{{fields["workflow"] | exists() | condition(format("{0} || uA1 || new workflow", fields["workflow"]), "")}}
-
fields["workflow"]gets the field value. -
exists()returnstrueif it has a value. -
condition(...)chooses the output: iftrue,format(...)builds the text, replacing{0}with the field value; iffalse, it returns an empty string.
Format an amount, or show a message if there isn't one
{{fields["gst_amount"] | greaterThan(0) | condition(format("${0}", fields["gst_amount"]), "No GST")}}
Returns the GST amount with a dollar sign, such as $12.50, if it's greater than 0. Otherwise returns No GST.
Nested calculations
{{multiply(add(fields["value1"], fields["value2"]), subtract(fields["value1"], fields["value2"]))}}
Calculates (value1 + value2) × (value1 − value2).
Build a safe file name
{{fields["title"] | sanitiseText("toAscii", "invalidFilenameCharacters") | trim()}}
Converts the title to plain ASCII, removes characters that aren't allowed in file names, and trims surrounding spaces. For example, Café: “Q1/Q2” Report becomes Cafe Q1Q2 Report.
Age from a date of birth
Calculates the number of whole years between a date field and today. Replace DATE_FIELD_ID with the id of the date field.
{{fields["DATE_FIELD_ID"] | asDate("yyyy-MM-dd") | format("{0:MM}") | greaterThanEquals(date | format("{0:MM}")) | condition(fields["DATE_FIELD_ID"] | asDate("yyyy-MM-dd") | format("{0:MM}") | equals(date | format("{0:MM}")) | condition(fields["DATE_FIELD_ID"] | asDate("yyyy-MM-dd") | format("{0:dd}") | greaterThan(date | format("{0:dd}")) | condition(subtract(date | format("{0:yyyy}"), fields["DATE_FIELD_ID"] | asDate("yyyy-MM-dd") | format("{0:yyyy}"), "1"), subtract(date | format("{0:yyyy}"), fields["DATE_FIELD_ID"] | asDate("yyyy-MM-dd") | format("{0:yyyy}"))), subtract(date | format("{0:yyyy}"), fields["DATE_FIELD_ID"] | asDate("yyyy-MM-dd") | format("{0:yyyy}"), "1")), subtract(date | format("{0:yyyy}"), fields["DATE_FIELD_ID"] | asDate("yyyy-MM-dd") | format("{0:yyyy}")))}}
Method index
|
Area |
Methods |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|