Variable References in Action Chains

Variables can be referenced for the parameter values of an action.

The runtime will automatically evaluate parameter values as expressions. Similar to the default value syntax of variables, variables can be referenced directly into an action parameter's value:

"myActionChain": {
  "root": "myAction",
  "actions": {
    "myAction": {
      "label": "some action",
      "module": "vb/action/builtin/someAction",
      "parameters": {
        "key": "{{ $page.variables.myVariable }}"
      }
    }
  }
}

Simple JavaScript code can be added to the values:

"myActionChain": {
  "root": "myAction",
  "actions": {
    "myAction": {
      "label": "some action",
      "module": "vb/action/builtin/someAction",
      "parameters": {
        "key": "{{ $page.variables.myVariable === 'yellow' }}"
      }
    }
  }
}

Non-expressions are entered in JSON:

"myActionChain": {
  "root": "myAction",
  "actions": {
    "myAction": {
      "module": "vb/action/builtin/someAction",
      "parameters": {
        "myString": "somestaticvalue",
        "myNumber": 1
        "myBoolean": true
      }
    }
  }
}

Map and array values are also expressed in JSON:

"myActionChain": {
  "root": "myAction",
  "actions": {
    "myAction": {
      "module": "vb/action/builtin/someAction",
      "parameters": {
        "key": { 
          "key1": "static value", 
          "key2": "{{ $page.variables.something }}"
        }
      }
    }
  }
}