Set State
The Set State action updates the state of a selected state container, page, or component. It allows you to modify specific pieces of state data dynamically, optionally triggering a UI rebuild to reflect these changes immediately.
Properties
State
Dropdown
Yes
Select the state container, page, or component whose state you want to update.
State Updates
Array
No
List of variable updates within the selected state. Each update contains a State Name (dropdown) and Value pair. Use "Add New" button to add multiple updates.
Rebuild UI
boolean
No
Whether to rebuild the UI immediately after the state update. Defaults to false.
Use Cases
Form Field Updates: Modify form input values based on user interactions
UI State Management: Control visibility, enabled state, or styling of components
Data Synchronization: Update state with API response data
Interactive Controls: Toggle switches, checkboxes, or selection states
Dynamic Content: Change displayed content based on user selections
Default Behavior
By default:
State Updates
All updates in the State Updates array are applied atomically
UI Rebuild
When Rebuild UI is false, state changes may not immediately update the UI
Expression Evaluation
All expressions in Value fields are evaluated in the current scope context
Error Handling
Invalid state context names throw an error
How to Use

Attach the action to a widget event (button tap, form submission, etc.)
Select Set State from the action list
Select the
Statefrom the dropdown to choose the target state containerIn the
State Updatessection, select a variableState Namefrom the dropdown for each updateSet the corresponding
Valuefor each variableClick Add New to add additional variable updates as needed
Optionally enable
Rebuild UIfor immediate visual updates
Implementation Details
The action requires a StateContextProvider ancestor in the widget tree to locate the specified state context. Each update in the State Updates array specifies a State Name and Value pair.
When Rebuild UI is true, the state context notifies listeners to trigger a UI rebuild. When false, the state is updated but the UI may not immediately reflect changes until the next natural rebuild.
State values can be any type (strings, numbers, booleans, objects, arrays) and support expressions for dynamic evaluation.
Related Actions
Set App State - Update global application state
Rebuild State - Trigger UI rebuilds without changing state values
Execute Callback - Handle state changes with custom logic
Last updated