Sign Up

Global Variables

Global variables in Twidget are key-value pairs that can be used anywhere across events, endpoints, and functions. They provide a powerful way to manage and share data throughout your projects.

-

Key Features

  • Data Types: Global variables support text, number, boolean, and date data types.

  • Security: Text values of the global variables are encrypted and hidden by default for added security.

  • Accessibility: Accessible anywhere in your no-code builder using the $global prefix.

  • Read Only: Global variables are immutable, meaning their values cannot be modified.

Best Practices

  • Avoid Overriding: It's recommended not to override the values of global variables to maintain consistency and avoid potential issues.

Creating and Managing Global Variables

  1. Open Global Variables Sidebar:

    • Click the Global Variables button located at the top of the builder interface.
  1. Add a New Global Variable:

    • In the sidebar that opens, click the Add button.

    • Provide a key and a value for the new variable.

    • Select the appropriate data type (text, number, boolean, or date).

  1. Edit an Existing Global Variable:

    • Find the variable you wish to edit in the list.

    • Update the key, value, or data type as necessary.

  1. Delete a Global Variable:

    • Locate the variable you wish to remove.

    • Click the Delete icon next to the variable.

Usage

To refer to a global variable in the builder, use the prefix $global followed by the variable's key. For example:


$global.variableName

This simple syntax ensures that your global variables are easily recognizable and consistently used throughout your projects.

Related Topics

Variables

Variables are essential building blocks in Twidget that allow you to store and manipulate data dynamically within your no-code applications. They enable you to create flexible and interactive applications by holding values that can be changed and referenced throughout your workflow. Creating Variabl...

Commands in Twidget

Commands are the building blocks of Twidget's no-code platform. They function like code statements and can perform various operations such as creating and updating variables, loops, conditionals, retrieving and manipulating data in the datastore, and much more. Creating a Command. 1. Navigate to the...

Testing

In Twidget, you can easily test your endpoints and functions directly within our code builder. This guide will walk you through the steps to efficiently test your functions to ensure they meet your requirements. Running Tests. To start testing, follow these steps: 1. Open Code Builder: - Navigate to...

Command Output

Some commands in Twidget return outputs, which are essential for dynamic and conditional logic within your workflows. These outputs are displayed next to the command and are prefixed with an "as" to indicate the variable name. Using Output Variables. Once a command returns an output, you can use the...

Publishing Changes

With Twidget's publishing feature, you can seamlessly push your changes live, ensuring that your updates take effect on the specified endpoint, function, or event. This feature also allows for version control, enabling you to revert and manage different versions of your changes effectively. Steps to...