Skip to main content

Setting variables

To create dynamic components using variable functions, typically follow the following procedure:

  1. Create (set) variables.
  2. After adding an action to update the variables,
  3. Make elements that are displayed differently depending on the variable.

The article below explains how to set basic variables. If you want to learn the functions through practice with the prepared tutorial, please proceed with the tutorial through the "Tutorial" link at the bottom of the page.

To create a variable, select the block you want to set the variable with and click Set variable in the Block menu.

Set Block Menu Variables

In the variable window, click the + button and choose one of the following three options.

New Variables

Import from the app (app variable)

Variables imported from the app contain special values provided by the app. For example, in the case of the Baedal Minjok app, it provides user information and device information are provided.

App Variable

  • Variable Name: Specifies the name of the variable to store the value imported from the app. (No spaces or special characters allowed)
  • Select data: Click this field to see a list of apps available.
caution

The values provided by each app, such as Baemin and Kaleidoscope, may be different. You must consider the environment in which a website made of mandao runs. For example, pages created using the Baemin app variable may not work properly within the kaleidoscope app.

Import from API (API variable)

When the block is displayed on the screen, calls automatically-set API and sets the value received as a response to the variable.

API variable

  • Variable Name: Specifies the name of the variable to store the value imported from the app. (No spaces or special characters allowed)
  • Select API: Click this field to see a list of APIs available.

Use another variable as API request value

When setting API variables, **the variable set above **can be used as the request value.

![Use other variables for variables] (/img/user-guide/using-variables-in-other-variable.png)

tip

Use API Call Action to call the API when you click on the block.

Create a new variable (custom variable)

A custom variable** that allows you to freely set or change any value initially.

Custom variable

  • Name of variable: Specifies the name of the custom variable. (No spaces or special characters allowed)
  • Variable Value (Select): Sets the initial value of the custom variable.

Custom variable application

You can configure the Mandao app that interacts with the user without the variables or API connection handed over by the app. Learn the functions of variables by creating a tab UI that shows different elements according to the user's click!

  • [Tutorial: Creating a tab UI] (/docs/tutorials/building-a-tab-ui)