Create and reuse variables
In Yogi Calculations - Formulas and Variables for Confluence, you create variables to:
Reuse results of previous calculations,
Create a dynamic ecosystem depending on other variables, or global standards.
How to create a variable?
There are 2 ways to create variables:
From a calculation macro inside the Confluence page, click on ‘Save as a variable’ and give it a name. You’ll be able to reuse that variable in this page only.
From the Space Apps, or the Confluence Administration, to create a specific variable that you’ll be able to reuse across one space, or many.
The variable name must contain only letters, numbers, hyphens and underscores (ex: variable_name
).
What kind of data is supported inside variables?
Variables can store:
A literal value (e.g.,
10
,"Hello"
,true
)Boolean (e.g.,
true
orfalse)
Numbers & decimals (e.g.
0
,1
,3.14
…)Strings (=Text) (e.g.,
“John doe"
…)
A formula (e.g.,
A + B * C
)A reference to another variable using the $ prefix, like
$myVariable
.
How to use a variable in a formula?
The syntax to use a variable is to put a $
in front of its name (e.g. $price * $quantity
).
If price
and quantity
are defined in the right scope, they’ll be evaluated.
What are the different levels of the variables?
It is possible to set up variables across multiple levels so you can share them through all your ecosystem.
Global variables
Users with global admin permissions can create global variables in the Yogi Calculations administration.
Those variables will be usable across all spaces.
To access:
🔐 Access restricted to global administrators.
Go to Confluence settings in the top menu.
Select Calculation Yogi.
Create or edit your global variables there.
![]() | ![]() | ![]() | ![]() | ![]() |
Space variables
Users with space admin permissions can create space variables in the Space Apps > Yogi Calculations.
These variables will be accessible for a whole space.
To access:
🔐 Access restricted to space administrators.
Open the target Confluence space.
Go to Space apps in the left sidebar.
Find Space apps > Calculation Yogi.
Create or edit your space variables there.
![]() | ![]() | ![]() | ![]() | ![]() |
Page variables
To access them, you simply need to add a basic calculation and save it as a variable.
The variable is stored directly within a page.
These variables are isolated, only available in that page.
Page variables can be created as documented in Insert the calculation macro .
Frequently Asked Questions:
Does Yogi Calculations support nested variables?
Yes! A variable’s value can reference other variables recursively (within a limit of 5).
Can I use the same variable name in different scopes?
Yes, but the closest scope takes priority:
A page variable with exactly the same name as a global or space variable will override them
A space variable with exactly the same name as a global variable will override it.
A global variable will be replaced by a space variable if they have the same name.
If you want to override that scope and look for a specific variable, you can use a syntax like $GLOBAL_Variablename
. See: Calculation syntax | Variable-expressions .