Docs »

Automations »

Commands »

var.set

The var.set: command sets a value using a key path.



start:
  set:
    person:
      name:
        first: Kina
  var.set:
    inputs:
      key: person:name:last
      value: Halpue
  return:
    output@text:
      {{person.name.first}} {{person.name.last}}


Result:


output: Kina Halpue

Syntax

inputs:

Key Req’d  
key: The key path of the value to set, delimited with colons (:).
value: The value to set.

output:

The optional placeholder to store the result.

on_simulate:

The commands to run during simulation instead of setting the value.

If omitted, the value is set during simulation.

on_success:

The commands to run on success.

The optional output: placeholder is set to the new value.

on_error:

The commands to run on failure. If omitted, the automation exits in the error state.

The output: placeholder receives a dictionary with these keys:

Key  
error The error message.