Skip to main content
Skip table of contents

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:

  1. 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.

  2. 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 or false)

    • 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:

    1. 🔐 Access restricted to global administrators.

    2. Go to Confluence settings in the top menu.

    3. Select Calculation Yogi.

    4. Create or edit your global variables there.

Screenshot from 2025-07-21 17-12-43.png
Screenshot from 2025-07-21 17-13-34.png
Screenshot from 2025-07-21 17-13-42.png
Screenshot from 2025-07-21 17-14-24.png
Screenshot from 2025-07-21 17-19-10.png

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:

    1. 🔐 Access restricted to space administrators.

    2. Open the target Confluence space.

    3. Go to Space apps in the left sidebar.

    4. Find Space apps > Calculation Yogi.

    5. Create or edit your space variables there.

Screenshot from 2025-07-21 17-02-35.png
Screenshot from 2025-07-21 17-02-50.png
Screenshot from 2025-07-21 17-12-06.png
Screenshot from 2025-07-21 17-12-28.png
Screenshot from 2025-07-21 17-18-07.png

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 .

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.