Skip to content
MyAppBuilder
StableState

App state

Overview

Variables shared by all pages during a visit, declared once with a name, a type and a default — optionally kept across reloads.

Purpose

Use it for things the whole app cares about: a shopping cart, the branch or location the user picked, display preferences, a wizard that spans pages. It replaces passing values from page to page.

Inputs

  • Declared under App state: key (letters, digits, underscores), type (string, number, boolean, json, list), default value, persist (keep in the browser after reload), description.
  • Changed with the Set state and Increase / decrease state actions (scope: App state).

Configuration

  • Keep the number of variables small and name them clearly (cartItems, selectedBranchId).
  • Defaults by type when none is set: empty text, 0, false, {} or [].

Outputs

  • Readable everywhere as App state › key, or {{state.key}} / {{app.key}} in templates. Lists feed Repeat for each and list components; json values are read with dots.

Example

Branch selector

Example
App state: branchId (string, default "", persist: yes)
Dropdown “Branch” › On change: Set state  App state › branchId = Event › value
Table (Appointments) · Filter: Branch equals App state › branchId

Errors

  • None; undeclared keys can still be set but do not appear in the Data Picker.

Limitations

  • Browser-only: not shared between users or devices, not available to workflows, not saved to the database.
  • Persisted values are stored unencrypted in the browser — never put sensitive data there.

Advanced

  • project.appState: StateVariable[]; the runtime store seeds appState from defaults, restores persisted keys from localStorage and writes them back on every change.

Related

Was this helpful?