--- title: "Variables" slug: "variables" status: "new" updated: 2025-05-30T17:56:42Z published: 2025-05-30T17:56:42Z canonical: "support.tulip.co/variables" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.tulip.co/llms.txt > Use this file to discover all available pages before exploring further. # Variables *Here's how to get started with variables and use them within your apps.* **In this article, you will learn...** - **How to start using Variables** - **How to utilize variables for more detailed Analytics** - **How to use variables alongside Triggers** ## Overview Variables are the primary means of storing and referencing data in your Tulip apps. When you want to store the value of a text input or access a pre-determined property of the app, you need a variable. Or, when you want to calculate specific values based on past user decisions within the app, you need a variable. Variables can either **reset upon app Completion** or **maintain their values through multiple completions** depending on your specific use case. When designing an app, a variable is often used to store the output from a device. A variable can also be used as the condition for other triggers which will drive app logic, either by: 1. Changing text displays 2. Advancing to other Steps, or... 3. Prompting the operator to perform another task. Variables are also needed to build detailed reports in the Analytics tool. If you want to individual data points from the operator, you will need to capture them in variables. ## Create a variable There are two primary ways to create a variable in the App Editor: - The **[variables dialog](/r230/docs/variables#variables-dialog)** - In a **[trigger](/r230/docs/variables#create-a-variable-in-a-trigger)** ### Variables dialog In order to create a new variable through the App Variables dialog, follow these steps: 1. Select the App Tab from the Side Pane. 2. Click on the ***X*** next to **Variables**. ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20To%20Create%20And%20Use%20Variables_471418756.png) 1. The modal that opens shows all the variables in the current app, along with associated attributes as described below: ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20To%20Create%20And%20Use%20Variables_471420060.png) ![How To Create And Use Variables_471418756.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20To%20Create%20And%20Use%20Variables_471418756.png) 1. Click **+ Create Variable**. 2. Name the variable and select a variable type from the dropdown. Click **+ Create**. ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20To%20Create%20And%20Use%20Variables_471423710.png) ## Variable attributes ### Data type The type of data being stored in the variable. This can take on one of the following values: - Number (including decimals) - Boolean (true/false) - Text - Integer - Interval (number of seconds) - Image (URL or manual upload) - Tulip User - Datetime (timestamp) - Station - Machine - Array (of any variable type listed) - Object - [Color](https://support.tulip.co/docs/how-to-dynamically-change-colors-of-widgets) Learn more about each data type [here](/r230/docs/data-types). ### Info and configuration **Where used**: A hierarchy displaying the step name and trigger / widget where the variable is in use. **Clear on Completion**: Whether or not the data in the variable gets cleared when the app is completed. Please note: these variables will be cleared after the "[Complete and Go To Splash Screen](https://support.tulip.co/docs/how-to-complete-an-app) action. Tip If you want a value to remain in the variable when the app is completed, un-toggle **Clear on Completion** for the variable. **Save for Analytic:** This toggle will be on by default. If you do not want a variable to be sent to an analysis for any reason, you may uncheck this box. Some variables may only be used for app logic, and are not needed in analytics. In these cases, it is best practice to not send them to analytics. Un-toggling non-essential variables may also help your analytics load faster as there will be less data to load in high-volume scenarios. **Default Value:** Set an initial value for the variable every time an operator starts the app ### Create a variable in a trigger When creating or editing a trigger, you can create a variable by following these steps: ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20To%20Create%20And%20Use%20Variables_471426638.png) 1. Create a new trigger. 2. In a new action, select **Data Manipulation** --> **Store**. 3. For this example, select **Static Value** --> **Text** --> "Text" location: **Variable** --> **New variable**. ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20To%20Create%20And%20Use%20Variables_471427516.png) 1. Type a name for the new variable and click the **green check**. 2. Click **Save**. The variable you create will be available to edit in the variable dialog. ## Persistent variables Persistent variables allow you to save a value in a Variable across multiple app Completions. Persistent variables **save values relative to each the device running the app. They will not be overwritten if the app is used on multiple devices simultaneously.** So, if you have a visual andon app with a persistent variable that runs on 5 production lines, each line supervisor can update the variable on their app and the values will not be overwritten or conflict. They exist independently on each tablet running the Player. ## Variables in form steps Warning As of r234, Form steps have been disabled for all new Tulip Instances. The last way to create a variable is **through a Form Step**. See the [guide to Form Steps](/r230/docs/how-to-build-your-first-form-step). ## Use variable text Once you create a variable, it is available for use in the actions and conditions of newly created and existing triggers in the app. It is also available in the Text widget, accessible from the Toolbar. ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20To%20Create%20And%20Use%20Variables_471429326.png) In order to access the value stored in a specific variable, select the relevant variable name from the Variables dropdown in the Side Pane: ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20To%20Create%20And%20Use%20Variables_292307571.png) You will be prompted to select your **Datasource**: - **Variable**: Any variable in your app that you've created - **App Info**: Variables that are automatically logged in your app (Ex: Logged-In User Name, Time Elapsed On App and Step Name) It is worth noting that variables are stored on a per-app basis, so there are **no step-specific variables** and they **cannot be shared between apps**. ## Delete Variables To delete a variable, you must remove it from all Triggers and Variable text widgets where it is being used. 1. Open the **Variables Dialog** from the App Tab of the Side Pane. ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20To%20Create%20And%20Use%20Variables_471430030.png) 1. Use the **Filter By** search box to find the variable you wish to delete. 2. Click the **...** icon on the far right. ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20To%20Create%20And%20Use%20Variables_471430961.png) ### Delete all unused variables The delete unused variables action erases all variables that are empty in the **where used** section. In the variables dialog, click the "**...**" icon and select **Delete unused variables**. ![new2.png](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/new2%281%29.png) ## Further Reading - [Best Practices for Naming Elements in Tulip](/r230/docs/best-practices-for-naming-elements-in-tulip) - [How to Dynamically Change the Color of Widgets](/r230/docs/how-to-dynamically-change-colors-of-widgets) --- Did you find what you were looking for? You can also head to [community.tulip.co](https://community.tulip.co/?utm_source=intercom&utm_medium=article-link&utm_campaign=all) to post your question or see if others have faced a similar question! **Variables** **Variables** are a location to store app information. Variables have a specific type that must match the contents they can store. Variables are only accessible within a single application and are cleared when the app is restarted or completed. **Analytics** **Analytics** are live updating graphs and metrics calculated based on app data, Table data, and machine data. Analytics can be embedded and dynamically filtered within an application. ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/image-1662410510869.png) **Trigger** **Triggers** are groups of logic that are tied to an app event, such as step open, timer, widget interaction, etc. App builders can add triggers to **widgets**, **machines**, **devices**, **apps**, and **steps**. **Triggers** can contain **actions**, **transitions**, and **conditions**. **App Completion** **App Completions** are a mechanism to store immutable data from a Tulip app. When an app is completed, all **Variable's** current values will be stored in the app completions tab. This completion data can be analyzed in **Analytics.** By default, after a Completion users will be brought back to the **Begin Screen** of your application. This behavior can be adjusted with other **Transition** types. **Steps** A view your users will see within an application. **Steps** can be viewed chronologically or in whatever order best fits your process. Steps can be grouped into **Step Groups** to manage and organize your app Steps. **App Editor** The web interface used for building applications. Where you design a user interface, add logic, and connect your applications to **Tables**. ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Screen%20Shot%202022-09-13%20at%207.50.23%20AM.png) **App Tab** In the **Side Pane**, the **App Tab** is where you can adjust all of the **App****-level** settings, including **App** **Triggers,** App background, App resolution, and more. ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/App%20Tab.png) **Side Pane** **(Context Pane)** The **Side Pane** is the configuration pane on the right side of the **App Editor** where steps, apps, and widgets can be configured. **Triggers** can be added to adjust widget behavior.![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Context%20Pane.png) **Number** **Number** is a Tulip Datatype. Numbers can be any positive or negative number. Numbers support decimals. *ex. -5, 15, 47, 155, 15.2, -12.73* **Boolean** **Boolean's** are a Tulip Datatype. Booleans can have True/False (Yes/No) values. **Integer** **Integers** are a Tulip Datatype. Integers can have any whole number. *ex. -5, 15, 47, 155. **NOT** 15.2, -12.73* **Interval** **Interval** is a Tulip Datatype. Intervals represent pieces of time, represented in seconds. Intervals can be added or subtracted from **Datetime** variables. **Image** **Images** are a Tulip Datatype. Images are a reference to a web-hosted location for all Tulip Images. **Datetime** **Datetimes** are a Tulip Datatype. Datetimes represent a time in the ISO8601 format. *ex. 2022-08-31T19:56:16+00:00* **Array** **Arrays** are a Tulip Datatype. Arrays are a list of other variables. Every element in an array must be the same type. Arrays are very useful when managing multiple values that represent the same information. *ex. The measurements of 10 quality checks can be stored in an Array of Numbers, as opposed to 10 Number variables.* **Object** **Objects** are a Tulip Datatype. Objects represent an arbitrary grouping of attributes. Leveraging objects can simplify the process of working with complex data architectures. Often **Connector** **Functions** will return **Arrays** of **Objects** *ex. My car object has 5 attributes, Color, Make, Model, # of wheels, # of seats.* **Analytic** **Analytics** are live updating graphs and metrics calculated based on app data, Table data, and machine data. Analytics can be embedded and dynamically filtered within an application. ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/image-1662410531382.png) **Variable** **Variables** are a location to store app information. Variables have a specific type that must match the contents they can store. Variables are only accessible within a single application and are cleared when the app is restarted or completed. **Widget Toolbar** The **Widget Toolbar** Is the menu where widgets can be found and added to your application. ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/toolbar.png)