Search

Home

Home

Global Variables

Global Variables

In the GRAVITY system, in addition to parameters defined individually for each project, a global variables mechanism is also available. These are special configuration values that you can declare once and reuse across all projects in the system.

Global variables act as shared constants, eliminating the need to duplicate the same information in multiple places. This greatly simplifies configuration management and makes the environment easier to maintain and update.

Typical uses of global variables include:

  • URLs for external systems (e.g., Web Service addresses),
  • authentication data (e.g., usernames, API tokens),
  • database schemas,
  • technical constants used across many projects (e.g., default limits, configuration flags).

Thanks to global variables, you can quickly modify the configuration of the entire system — for example, changing a single Web Service server address will automatically update all projects that use that variable, without the need to manually edit each project individually.

Global variables are defined and managed from the GRAVITY administrative environment and can be used anywhere in a project where the system supports variable usage.

The global variable mechanism is one of the key tools that increase the modularity, clarity, and flexibility of projects built in GRAVITY.

CREATING A GLOBAL VARIABLE

To add a new global variable, click the New… button.

image

Enter the variable name, type, and value.

image

The GRAVITY system supports the following variable types:

  • String – any text string
  • Integer – a decimal numeric value
  • Double – a floating-point numeric value
  • DateTime – a date with time (if only a date is provided, the time defaults to 00:00:00)
  • Boolean – takes the value true or false
  • Blob – binary data (requires Base64 encoding)
  • ArrayString – an array of text strings in the format: [’item 1’, ‘item 2’]
  • ArrayInteger – an array of decimal values in the format:[2,3,4,5]
  • ArrayDouble– an array of floating-point values in the format: [1.1, 1.2, 2.1]

USING GLOBAL VARIABLES IN PROJECTS

You can use global variables in any operator whose fields support parameterization, such as INPUT SQLINPUT SQL, CALL SQLCALL SQL, IFIF, INPUT REST APIINPUT REST API, and others.

image
image

Global variables appear in the list of available parameters for the field.

image

When you select a global variable, it is inserted into the field in the format {{variable_name}}.

image

During process execution, the variable will be replaced with the specific value it holds.