Skip to main content

Celonis Product Documentation

Package runtime Variables

Note

You're currently viewing a topic describing a Studio feature using the general availability feature set. This feature is also available in the new Studio experience, however both the design and the way it works may be different to what you see described here.

For more information about the new Studio experience, see: Studio (new experience)

Overview

This new kind of variable is on package level, so it is potentially available in all assets (like Views and Knowledge Models) [Only exception currently: it does not work in modal or slide-in profile views]

It is also evaluated on "runtime" meaning that changing the value of this variable will change throughout all users and places within Studio or Apps respectively. Changes in Studio are not synced to Apps and vice-versa.

Naming your Variables

Do not use special characters like - + / * or $%§ in your variable names.

Creating a package variable

Note

Currently, only runtime variables of type String can be created. You can still complete this string with a number and use it in PQL calculations as a PQL formula is also a string (specific strings are defined using apostrophes (') ).

  1. Go to your package settings and click Create Variable and then Plain Text Value.

    50725750.png
  2. When prompted, add a key, a value and a description for your variable; the key is the reference for your variable while using it within assets, the other attributes are optional.

    50725751.png
  3. Save your variable; it will now be displayed in the runtime variable section. You will also be able to see where the runtime variable is currently being used and what its current value is.

    50725752.png

Tip

It can sometimes be helpful to refresh the browser at this point (also if you have for example the view open where you want to use the variable) to make sure the variable is recognised in your configuration.

Using package variables inside Views

Runtime variables are used the same way as to view variables in views. We simply use the same syntax as you are used to from local variables (${ ... }) and then the key of the runtime variable defined in the package settings.

Please note

Do not declare the variable again in the view (under "variables: ") this local variable will overwrite the package variable.

  • If you want to use the value of the variable, use: ${...}

  • If you want to reference to the variable itself (for example to fill the variable) use the plain variable key

components:
- id: my-id
  type: text-box
  settings:
    content: This is text with the following variable -> ${ myRuntimeVariableKey } 

or:

...
onChange:
  update:
    variables:
      - name: myRuntimeVariableKey (if you want to reference to the variable and not to the value within)

Using package variables inside Knowledge Models

Use double braces in the Knowledge Model to access the package variable value: e.g.: ${{runtimeVariable}}

kpis:
- id: KPI_RUNTIME_TEST
  displayName: runtime test variable
  pql: COUNT(DISTINCT ${VARIABLE_INVOICE_KEY}) * ${{runtimeVariable}}
  ...
Package runtime variable behaviour
  • The first time you publish a package with a new runtime variable, the variable will be set in Apps with the current value, but it will then not be linked to the version in the Studio anymore.

  • Runtime variables won't work in profile views (opened as modal or slide-in).

  • If a component is built to update view variables, it will also update runtime variables (ex: you can update a runtime variable using the kpi-list by clicking a KPI, if you are in tile view and defined the onClick behavior).

  • Runtime variables don't need to be declared in your view, you can just use the key and it should work 'out of the box'.

  • If a variable is declared in the view which has the same name as the key of a runtime variable, the view will ignore the runtime variable and work with the defined variable in the view instead. i.e: when updating the variable, only the value of the view variable will be changed and not the package runtime variable. If you want to change that, you need to remove the declaration of the variable with the same name from the view.