---
title: Configuring Variables
description: Discover how to configure variables in your application with our comprehensive guide. Optimize your data and improve your code's performance!
---

[Skip to content](https://support.intelligenceindustrielle.com/en/base-de-connaissance/configuring-variables#main-content)

- [English](https://support.intelligenceindustrielle.com/en/base-de-connaissance/configuring-variables)
- [Français](https://support.intelligenceindustrielle.com/fr/base-de-connaissance/configurer-des-variables)

English

Show submenu for translations

![](https://support.intelligenceindustrielle.com/hs-fs/hubfs/Logo%20Intelligence%20Industrielle.png?width=100&height=75&name=Logo%20Intelligence%20Industrielle.png)

Open main navigation

Close main navigation

- - [English](https://support.intelligenceindustrielle.com/en/base-de-connaissance/configuring-variables)
    - [Français](https://support.intelligenceindustrielle.com/fr/base-de-connaissance/configurer-des-variables)

  English
  
  Show submenu for translations
- Contact us

 Contact us

 How can we help you?

- There are no suggestions because the search field is empty.

1. [Knowledge Base](https://support.intelligenceindustrielle.com/en/base-de-connaissance?hsLang=en)
2. [Advanced Features & Configuration 🤓](https://support.intelligenceindustrielle.com/en/base-de-connaissance/advanced-features-configuration?hsLang=en)
3. [Advanced Configuration - Expert's Zone](https://support.intelligenceindustrielle.com/en/base-de-connaissance/advanced-features-configuration?hsLang=en#advanced-configuration-experts-zone)

May 1, 2025

# Configuring Variables

## Discover how to configure variables in your application with our comprehensive guide. Optimize your data and improve your code's performance!

**Configuring variables** is an essential step to customize and optimize your application. Variables allow you to **store data** and reuse it in different parts of your program. In this article, we detail the steps to **add and configure variables**, as well as the **best practices** to follow for effective use.

### Step 1: Access the variables section

To begin, access your application's configuration view and navigate to the **Variables** section. There, you will find a list or table displaying all the existing variables in your application.

### Step 2: Add a new variable

To **add a variable**, click on the **Add** button located at the top right of the variables table.

### Step 3: Name the variable optimally

In the add form, start by **naming your variable** in the **Variable Name** field. A clear and descriptive name facilitates maintenance and reuse of the variable in your application.

#### **Variable naming rules:**

1. **Avoid spaces and special characters**: Use underscores (\_) to separate words if necessary.
2. **Numbers are allowed but not as the first character**: For example, `variable1` is valid, but not `1variable`.
3. **Do not use reserved names**: Avoid protected names such as `NOW` or `TIME`.
4. **Ensure unique names**: Each variable must have a unique name, different from other variables and flow properties.

#### **Naming Example:**

To convert a temperature from Celsius to Fahrenheit, you can name the variable `temperature_fahrenheit`.

### Step 4: Configure the variable expression

After naming the variable, define its **expression**. The expression determines the value of the variable and can be:

- **A constant**: A fixed number or a string of characters.
- **A boolean expression**: Returns `true` or `false`.
- **A mathematical expression**: Uses arithmetic operators to calculate a value.
- **A conditional expression**: Uses ternary operators to implement conditions.

#### Using existing variables in the expression

To reference other variables or flow properties in your expression, use the `$` symbol. A dropdown list will appear, allowing you to select the desired variable.

#### **Expression Example:**

To convert a temperature in Celsius (variable `$temperature_celsius`) to Fahrenheit:

```
($temperature_celsius * 9/5) + 32
```

### Step 5: Use Ternary operators for conditions (optional)

**Ternary operators** allow you to introduce conditions into your expressions. They are useful for creating variables whose value depends on certain conditions.

#### **General Syntax:**

```
condition ? value_if_true : value_if_false
```

#### **Usage Example:**

To define a variable `is_hot` that is `true` if the temperature is above 25°C:

```
$temperature_celsius > 25 ? true : false
```

*To learn more, consult our article regarding our* [library of ternary functions](https://support.intelligenceindustrielle.com/en/base-de-connaissance/en/librairie-des-fonctions-ternaires?hsLang=en)*.*

### Step 6: Add units to the variable (optional)

In the **Units** field, you can specify the **unit of measurement** of your variable. This is particularly useful for numerical values representing physical measurements.

#### **Example:**

For the variable `temperature_fahrenheit`, you can indicate `°F` as the unit.

### Step 7: Add a tag for better organization (optional)

The **Label** field allows you to assign a **category** or **keyword** to your variable. Labels facilitate grouping and searching variables in your application, especially when there are a large number.

#### **Example:**

You can label your variable with `temperature` or `conversion` to find it more easily.

### Step 8: Save and finalize the variable

Once all the fields are filled, click on **Save** to **add the variable** to your application.

### Best practices for configuring variables

- **Name variables clearly**: Use descriptive names to facilitate code understanding.
- **Verify expressions**: Ensure that formulas are correct to avoid runtime errors.
- **Use units and labels**: Although optional, they improve readability and organization.
- **Reuse variables**: Take advantage of the power of variables by referencing them in other expressions to optimize your code.

### Conclusion

**Configuring variables** is a simple yet powerful approach to enrich and optimize your application. By following the outlined steps and applying these best practices, you can create effective variables and contribute to a more dynamic and functional application.

Feel free to further explore the possibilities offered by expressions and ternary operators to **optimize your variables** and improve your application's performance.

- [Key Concepts 🔑](https://support.intelligenceindustrielle.com/en/base-de-connaissance/key-concepts?hsLang=en#main-content)

    - [KPI Introduction](https://support.intelligenceindustrielle.com/en/base-de-connaissance/key-concepts?hsLang=en#kpi-introduction)
- [Advanced Features & Configuration 🤓](https://support.intelligenceindustrielle.com/en/base-de-connaissance/advanced-features-configuration?hsLang=en#main-content)

    - [Advanced Configuration - Expert's Zone](https://support.intelligenceindustrielle.com/en/base-de-connaissance/advanced-features-configuration?hsLang=en#advanced-configuration-experts-zone)
    - [Tiles - Creation & Customization](https://support.intelligenceindustrielle.com/en/base-de-connaissance/advanced-features-configuration?hsLang=en#tiles-creation-customization)
- [Advises & Best Practises 👌](https://support.intelligenceindustrielle.com/en/base-de-connaissance/advises-best-practises?hsLang=en#main-content)

    - [Tips & Advices](https://support.intelligenceindustrielle.com/en/base-de-connaissance/advises-best-practises?hsLang=en#tips-advices)
    - [Case Studies & Feedbacks](https://support.intelligenceindustrielle.com/en/base-de-connaissance/advises-best-practises?hsLang=en#case-studies-feedbacks)
- [Getting Started 👣](https://support.intelligenceindustrielle.com/en/base-de-connaissance/getting-started?hsLang=en#main-content)

    - [User Manuals 📖](https://support.intelligenceindustrielle.com/en/base-de-connaissance/getting-started?hsLang=en#user-manuals)
    - [Initial Set-up ⚓](https://support.intelligenceindustrielle.com/en/base-de-connaissance/getting-started?hsLang=en#initial-set-up)
- [Machine Connectivity 📡](https://support.intelligenceindustrielle.com/en/base-de-connaissance/machine-connectivity?hsLang=en#main-content)

    - [K2 IoT](https://support.intelligenceindustrielle.com/en/base-de-connaissance/machine-connectivity?hsLang=en#k2-iot)

[![Logo Intelligence Industrielle](https://support.intelligenceindustrielle.com/hs-fs/hubfs/Logo%20Intelligence%20Industrielle-3.png?width=162&height=50&name=Logo%20Intelligence%20Industrielle-3.png "Logo Intelligence Industrielle")](https://www.intelligenceindustrielle.com)

266 rue Saint-Paul E, Montréal, (Québec) H2Y 1G9

<https://www.facebook.com/IntelligenceIndustrielle/> <https://www.linkedin.com/company/intelligence-industrielle/> <https://www.youtube.com/@intelligenceindustrielle586> [mailto:success@intelligenceindustrielle.com](mailto:success@intelligenceindustrielle.com)

Copyright © 2025, Fait avec 🧠 par intelligenceindustrielle.com