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.
Use Cases
Updating form field values or user inputs.
Changing visibility or properties of UI components.
Dynamically adjusting state based on user interactions or API responses.
Properties
stateContextName
(Required) The name of the state container, page, or component whose state you want to update.
updates
An array of objects describing the state changes to apply. Each object typically contains keys and new values.
rebuild
Boolean indicating whether to rebuild the UI immediately after the state update. Defaults to false
.
Default Behavior
State is updated according to the provided
updates
.If
rebuild
istrue
, the UI context is refreshed to reflect the changes.If
rebuild
isfalse
, changes may not immediately update the UI until next rebuild.
How to Use
Attach the action to a widget event.
Select Set State from the action list.
Specify the
stateContextName
.Provide the
updates
array with state changes.Optionally enable
rebuild
to refresh the UI immediately.
Last updated