Handlebars Helpers
ADL templates are written in Handlebars. On top of the standard Handlebars syntax, ADL registers a set of helper functions that make working with metadata easier: comparing strings, looking up extension properties, branching on classifications, generating stable identifiers, and so on.
These helpers can be used inside any template. For the concepts, see Templates & Code Generation.
Lookups
Section titled “Lookups”exists: check whether a named extension property exists on a Data Object.lookupExtension: read the value of an extension property.lookupConnection: read a property of a named connection.targetDataItemExists: check whether a Data Item exists on the target Data Object.
Classifications and lists
Section titled “Classifications and lists”hasClassification: branch on whether a classification with a given name is present.hasClassificationGroup: branch on whether any classification in a given group is present.hasStringValue: branch on whether a value exists in a list of strings.{{*filter}}: filter a list before iterating it in aneachblock.{{*order}}: sort a list before iterating it in aneachblock.
Identifiers
Section titled “Identifiers”createDeterministicGuid: create a GUID derived from input values, stable across generation runs.createGuid: create a new random GUID.
Strings
Section titled “Strings”stringCompare: compare two strings.stringDiff: branch when two strings differ.stringReplace: replace substrings.stringUpper: convert to uppercase.stringLower: convert to lowercase.stringWrap: wrap a string with a given prefix and suffix.substring: take the part of a string after a delimiter, for example to strip prefixes likeHUB_.replicate: repeat a string N times.space: emit N spaces, useful for indentation.
Dates and test data
Section titled “Dates and test data”now: the current timestamp.randomDate: a random date within a range.randomNumber: a random number within a range.randomString: a random string.
Where these come from
Section titled “Where these come from”The helpers are registered by ADL’s generation engine when templates are rendered, both in the app and during automated generation runs.