How to Work with Variables

Variables are the user defined fields that:

  • can have any desirable name

  • can have value of String type

  • can be inserted anywhere as Merge field

  • can be updated by Actions

  • are initialized with initial values when Kanban page is loaded or reloaded

  • are stored in memory and do not changed when Kanban is refreshed by Kanban API or "Refresh Kanban" button (and this is a perfect tool to dynamically change a lot of Kanban properties)

Variables are configured in the proper section of Kanban Properties sidebar.

To see what values are stored in the variables, and manipulate with them, user can open a Debug Console on Kanban.

Variables can be changed by different actions:

  • "Update Variables" method of Kanban API - it allows the simple update of variable with some value.

  • "Define Variable" Global Action - it allows to make calculations with variable values using formulas.

Define Variable Action called from Kanban has these properties:

  • it always return updated variables to Kanban where it has been called from

  • it need to know the name of variable to update

Example of how to CHANGE variable value via Define Variable Action:

1. Configure action in this way:

  • Type = Define Variable

  • Variable Type = JSON

  • Variables JSON example:

{"{$Variables.IncomingVariableName}":"FORMULA[IF({$Variables.IncomingVariableValue} != '1','zero','one')]"}

This formula updates variable value to "one" if its initial value is "1", and to "zero" if not.

In the example above name of variable to update is got from Action incoming variables (that work as parameters) using merge field {$Variables.IncomingVariableName}. Initial value of variable to update is set by {$Variables.IncomingVariableValue}. Thus, an action call can pass any Kanban variable to action as pre-defined variables named "IncomingVariableName" and "IncomingVariableValue". This will allow user to re-use this action anywhere with other variables.

2. Define some variable on Kanban, e.g. variable name = "TheVar" and value = "A":

3. Configure an action (e.g., as handler on some element) and pass this variable name and value to action via action incoming variables:

Save Kanban. To test variables update open Kanban and check variable in Debug Console. It will show initial variable value:

Click on element with this action set as handler. Then open debug console again to see an updated variable:

This way does not allow to update variable in other Kanban, but you can first update variable in current Kanban with global action, and then pass new value to other Kanban via Kanban API "Update Variable" method.

Last updated