Jun 22, 2022·1 min read

Creating Global Variables in AppMaster

Learn how to create global variables in AppMaster.

Creating Global Variables in AppMaster

Global Variables in AppMaster allow you to store data in RAM, which significantly speeds up your work with the applications.

To create a global variable in the backend, go to the Business Logic/Global variables tab and click Create Global Variable

In the newly opened window, you can set the type of a variable, its name, and description and make it unchangeable (read-only).

To create a global variable for a web application’s frontend, you need to go into the web application editor, click the Global variables tab and then click the Create global variables button.

Settings are similar to what we have in the backend part.

To create a global variable in the mobile app, you need to go to the business processes tab (Global variables sections).

The variable settings are completely similar to the settings of the frontend and backend parts of your application. The value of a global variable can be set not only when creating it but also dynamically in with the use of business processes. Find the corresponding variable block in the business processes designer and drag it into the canvas.

The variable value can be defined with the use of the Set Variable block.

FAQ

What are global variables in AppMaster?

Global variables store values in RAM so different parts of an AppMaster application can access them quickly. You can create them for the backend, web frontend, and mobile app.

How do I create a backend global variable?

Open Business Logic, choose Global variables, then click Create Global Variable. Set the type, name, description, and read-only option in the dialog.

How do I add a global variable to a web app?

Open the web application editor, select the Global variables tab, and click Create global variables. The setup fields match the backend version.

Where do I create global variables for a mobile app?

In the mobile app editor, open the Business processes tab and select the Global variables section. Create the variable and fill in the same settings used elsewhere.

What settings can I choose for a global variable?

Choose a type that matches the value you plan to store, then give the variable a clear name. Add a description when it helps other builders understand its purpose.

What does read-only mean for a global variable?

A read-only variable keeps its value from being changed after you set it. Use it for values that your application should expose but not modify during normal operation.

Can a business process change a global variable?

Yes. Create the variable first, then use the matching variable block in the Business Process Editor. Set Variable lets a process assign a new value while the app runs.

How do I set a variable value in a business process?

Drag the relevant global-variable block onto the Business Process Editor canvas. Use the Set Variable block to define the value you want the process to store.

When should I use a global variable?

Use global variables for data that multiple processes or screens need to access quickly during an application's runtime. Keep their purpose narrow so values stay easy to track.

Do backend, web, and mobile apps share the same global variables?

No. Backend, web frontend, and mobile apps each have their own Global variables area. Create the variable in the part of the application where you need to use it.

Easy to start
Create something amazing

Experiment with AppMaster with free plan.
When you will be ready you can choose the proper subscription.

Get Started