Momen Docs
Go to Momen
  • Get Started
    • Introduction
    • Quick Start
    • Software Development Process
    • Editor Overview
  • Changelog
    • Latest Product Update
  • Build UI
    • Pages
    • Components
    • Canvas
    • Layout
    • Component - Display
    • Component - Input
    • Component - View
    • Component - List
    • Component - Tab View
    • Component - Select View
    • Component - Conditional View
    • Component - Others
    • Component - Map
    • Custom Component
  • Data
    • Overview
    • Data Model and Database
    • API
    • Variable
    • Parameter
    • Formula and Conditions
  • Actions
    • Overview
    • Request
    • Navigation
    • Actionflow
      • Custom Code
      • Database Trigger
    • AI
      • AI Data Model
      • AI Point
      • Vector Data Storage and Sorting
    • User Actions
    • Component Management
    • App and Page Management
    • Toast Notifications & Modal
    • Payment
    • SSO
    • Share
    • Location
    • File Management
    • QR Code
    • Clipboard
    • Conditional
    • Loop
  • Release and Growth
    • Publish Application
    • Upgrade Project
    • Multiple Clients
    • Permission
    • Log Service
    • SEO
    • Hosting Files
  • My Account and Community
    • My Wallet
    • Promoting Momen
    • Code Component
    • Collaboration
  • Debugging
    • How to Debug in Momen
    • Request Error Reference
  • Tutorial
    • How to Build an AI Needs Analysis Project?
    • How to Set Up Payment with Stripe Plugin?
    • How to Embed an Iframe Component into Your Momen Project?
    • How to Build Your Login Page?
    • How to Convert Momen App to Native Mobile App?
    • How to Build a CMS (MVP Version) in Hours?
    • How to Set a Countdown Timer When Sending a Verification Code
  • Template
    • AI Mental Health Assistant
    • Angry Dietitian
    • AI Help Center
    • AI Knowledge Base
    • SaaS Corporate Site
    • Blog
    • AI Feedback Tool
    • Feedback Tool, a Nod to Canny
    • Portfolio
    • Online Courses, a Nod to Udemy
    • Mobile Auto Repair AI Scheduler
Powered by GitBook
On this page
  • Global Variables
  • Page Variables
  1. Data

Variable

Learn how to use variables in Momen, including the definition, assignment, and referencing methods of global variables and page variables. Through illustrated examples, clearly explain the scope and u

PreviousAPINextParameter

Last updated 1 day ago

In many scenarios, data is not used directly but is stored in a variable to achieve data reuse. Variables are divided into "global variables" and "page variables" based on their scope. The use of variables involves three steps: "definition," "assignment," and "reference."

Global Variables

Global variables are variables that can be referenced by all pages, typically used to store global configuration information.

  1. Definition

Open "Settings," go to "Global," and then "Add Global Variable." Choose a variable name, select a type, and set a default value (optional) to define a global variable.

  1. Assignment

Assign values through "Set Global Data," which can be used in global settings or on a page.

  1. Reference

Global variables can be referenced by all pages.

Page Variables

Page variables are variables that can be referenced by all components and actions within a page, used to store data related to that page.

  1. Definition

Enter the page, open "Data," and then "Add Page Variable." Choose a variable name, select a type, and set a default value (optional) to define a page variable.

  1. Assignment

Assign values through "Set Page Data."

  1. Reference

Page variables can be referenced by all components and actions within the page.