Set App State
The Set App State action allows you to update the global application state. This is useful for managing state that affects the entire app or multiple components, enabling centralized control over app-wide data.
Properties
State Updates
Array
Yes
List of state updates. Each update contains a State Name (dropdown) and Value pair. Use "Add New" button to add multiple updates.
Use Cases
User Authentication: Manage login status and user data globally
Theme Management: Control app-wide theme and appearance settings
Language Settings: Store user language preferences across the app
Shopping Cart: Maintain cart state across different pages
App Configuration: Store feature flags and configuration settings
User Preferences: Save user choices and settings globally
Default Behavior
By default:
Global Scope
Updates affect all parts of the app
Persistence
State changes persist until app restart
No UI Rebuild
UI updates only when components subscribe to changes
Multiple Updates
All state updates are applied in sequence
Expression Evaluation
All Value expressions are evaluated before updating
How to Use

Attach the action to a widget event (login, settings change, etc.)
Select Set App State from the action list
In the
State Updatessection, select aState Namefrom the dropdown for each updateSet the corresponding
Valuefor each state variableClick Add New to add additional state updates as needed
Implementation Details
The action uses DUIAppState().update() to modify global application state. Changes are immediately available throughout the app and persist until the app is restarted.
State values can be any type (strings, numbers, booleans, objects, arrays) and support expressions for dynamic evaluation.
Example native code usage:
Related Actions
Set State - Update page or component-specific state
Rebuild State - Trigger UI rebuilds for state changes
Execute Callback - Handle state change callbacks
Last updated