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

Property
Description

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 is true, the UI context is refreshed to reflect the changes.

  • If rebuild is false, changes may not immediately update the UI until next rebuild.

How to Use

  1. Attach the action to a widget event.

  2. Select Set State from the action list.

  3. Specify the stateContextName.

  4. Provide the updates array with state changes.

  5. Optionally enable rebuild to refresh the UI immediately.

Last updated