# Vars functions

# firstDefined First defined variables

Return the first defined variables or throw an exception if no variables are defined.

{{ firstDefined outputs.task1.uri outputs.task2.uri }}

# eval Evaluate a handlebars expression

Evaluate a handlebars expression at runtime based on the whole context.

Mostly useful for Lookup in current childs tasks tree and dynamic tasks.

{{ eval 'outputs.first.[{{taskrun.value}}].value' }}

# firstDefinedEval First defined evaluation

First defined evaluates a handlebars expression at runtime based on the whole context or throws an exception if no variables are defined.

Mostly useful for Lookup in current childs tasks tree and dynamic tasks.

{{ firstDefined 'outputs.first.value' 'outputs.first.[{{taskrun.value}}].value' }}

# get get an element for an array or map by key

   {{get object ["key"]}}
  • get on object type map, the key at key
  • get on object type array, the index at key

Mostly useful for Lookup in current childs tasks tree and dynamic tasks.

{{ get outputs 'first' }}