Skip to main content

Custom Helpers Reference

Collate provides 24 custom helpers to format and manipulate event data. This page also covers the standard Handlebars lookup helper. Use these helpers to transform data in your notification templates.
Combine multiple helpers to create powerful template logic. For example, use filter to show only failed tests, then limit to display only the first 5 items.

Data Extraction

pluck - Extract properties from objects

Extracts a specific property from each object in an array. Syntax:
Example:
Extracts the tagFQN property from each tag object, resulting in a simple list of tag names.

filter - Filter lists by property value

Filters array items based on property values. Syntax:
Example:
Filters test results to show only failed items.

split - Split strings into arrays

Splits a string by a delimiter into an array of parts. Syntax:
Example:
Splits a qualified name like database.schema.table into individual parts for display. Advanced Example - Nested Field Parsing: When parsing hierarchical field names like columns.columnName.tags, combine with lookup:

limit - Limit array items

Limits the number of items displayed from an array. Syntax:
Example:
Shows first 5 items and mentions count of remaining items.
Combine limit with other helpers to prevent large notifications:

lookup - Access array element by index

Accesses a specific element in an array by its index (0-based). Syntax:
Example:
Useful for accessing specific parts after using split helper to parse hierarchical names.

String Operations

camelCaseToTitle - Convert camelCase to Title Case

Converts camelCase strings to Title Case format. Syntax:
Example:
Converts testCase to Test Case, dataAsset to Data Asset.

startsWith - Check string prefix

Checks if a string starts with a specific prefix. Syntax:
Example:
Useful for identifying specific field types in change descriptions.

endsWith - Check string suffix

Checks if a string ends with a specific suffix. Syntax:
Example:
Useful for identifying specific field types in change descriptions.

textDiff - Show text differences

Displays the difference between old and new text with strikethrough and highlighting. Syntax:
Example:
Renders old text with strikethrough and new text highlighted, making changes easy to spot. Optional Parameters: You can customize the HTML tags used for insertions and deletions:
  • insTag: HTML tag for inserted text (default: "b")
  • delTag: HTML tag for deleted text (default: "s")
Email notifications remove tags they don’t allow, such as mark.

truncate - Shorten text

Shortens text to a maximum length. When the text exceeds the limit, the helper replaces the final character with an ellipsis (…) so the result remains within the requested length. Syntax:
Example:
Returns the original text when it is within the limit. A missing or invalid limit also returns the original text.

Comparison & Logic

eq - Equality check

Checks if two values are equal. Syntax:
Example:

gt - Greater than

Checks if first value is greater than the second. Syntax:
Example:

and - Logical AND

Combines multiple conditions with logical AND. Syntax:
Example:
Shows content only if both conditions are true.

or - Logical OR

Combines multiple conditions with logical OR. Syntax:
Example:
Shows content if any condition is true.

not - Logical NOT

Inverts a condition. Syntax:
Example:

Collection Operations

groupEventChanges - Group changes into categories

Organizes field changes into separate categories: updates, additions, and deletions. Syntax:
Example:

hasFieldInChanges - Check if field was modified

Checks if a specific field was modified in the change description. Syntax:
The first argument is the grouped changes from groupEventChanges, not event. The second argument is the field name as recorded in the change event, for example entityStatus or testCaseResult. The helper checks the updated, added, and deleted fields. Example:
Must be used with changes from groupEventChanges. Passing event or event.changeDescription directly doesn’t work. A create event has no list of changes, so the helper returns false for it. Soft-delete and restore events list only the deleted field.
Example: data contract status change

length - Get array/string length

Returns the number of items in an array or characters in a string. Syntax:
Example:

Formatting

formatDate - Format timestamps

Converts timestamps to human-readable date and time format. Syntax:
Example:
Converts timestamps to format like: 2025-11-13 14:30:00 The helper takes one value and has no format or timezone option. The output is always yyyy-MM-dd HH:mm:ss in the timezone of the Collate server. It accepts a timestamp in milliseconds, a date, or a number written as text. For any other value it returns the value unchanged, and for an empty value it returns an empty string. Creates a clickable URL that opens the entity in Collate UI. Syntax:
The first argument is the entity type and the second is the entity. You can also pass the entity type and a fully qualified name, for example {{buildEntityUrl 'table' entity.fullyQualifiedName}}. This form renders an empty link for data contracts, queries, and ingestion pipelines, so pass the full entity for those. For a data contract, the link opens the contract tab of its asset. A single argument, such as {{buildEntityUrl entity}}, doesn’t work and renders an empty link. The optional last argument adds the entity’s Activity Feed to the link. Use "tasks" to open the Tasks view of the feed. Any other value, for example "all", opens the All view. For a test case, any value of this argument opens the Issues tab instead. Example:
Generates a link like: https://your-Collate/table/database.schema.table Extracts entity information from entity link strings. Syntax:
Example:
The returned object contains entityType, entityFQN, field, arrayField, and arrayValue. For a column test, arrayField contains the column name.

renderTableSample - Show a table of failed rows

Draws a small table with a sample of the rows that failed a data quality test. Use it in templates for test case alerts. Simple version: Show up to 10 columns and 3 rows.
Full version: Show the tested column in bold and set the maximum number of columns and rows.
  • 10 is the maximum number of columns to show.
  • 3 is the maximum number of rows to show.
  • link.arrayField is the name of the column that the test checks.
When more data is available, the table adds ... and N more. Use three curly braces ({{{ }}}). With two curly braces, the notification displays the table as raw code. Converts @mention syntax to clickable user profile links. Typically used with user-entered descriptions or comments that may contain @mentions to team members. Syntax:
Example:
Converts mentions added in the rich text editor to links to the user’s profile. Text typed as a plain @john.doe stays unchanged.
Use three curly braces {{{ to render HTML output without escaping.

resolveDomain - Resolve domain references

Displays domain names even when passed as object references. Syntax:
Example:
This helper gracefully handles multiple input types:
  • Domain object references: {{resolveDomain domain}}
  • Already-resolved domain strings: {{resolveDomain "domain-name"}}
  • Null/undefined values: Returns (no domain)

Math Operations

math - Perform calculations

Performs mathematical operations on numbers. Syntax:
The helper takes exactly three values: a number, an operator, and a second number. It ignores anything after the second number. Supported Operators:
  • + - Addition
  • - - Subtraction
  • * - Multiplication
  • / - Division
  • % - Remainder (modulo)
  • round - Round the first number to the number of decimal places given as the second number
Example:
Calculates: (passedTests ÷ totalTests) × 100, rounded to 2 decimal places. round is a separate step, so nest one math call inside another for each step.
If a value isn’t a number, the operator isn’t supported, or you divide by zero with /, the helper returns 0 and doesn’t show an error. A remainder by zero (% with 0) returns NaN.
More Examples:

Next Steps