# Rebuild State

{% embed url="<https://youtu.be/ucwzWoiWXfg?si=cl6KSnPDPzYJjqY6>" %}

Watch this on Youtube: <https://www.youtube.com/watch?v=ucwzWoiWXfg>

The **Rebuild State** action triggers a rebuild or refresh of a specific state context within the app. This can be used to force the UI to update based on changes in state or to reinitialize parts of the app dynamically.

***

#### 📦 Properties

| Property | Type     | Required | Description                          |
| -------- | -------- | -------- | ------------------------------------ |
| `State`  | Dropdown | Yes      | Name of the state context to rebuild |

***

#### ✅ Common Use Cases

* Refreshing UI after external data updates
* Forcing re-render of components with dynamic content
* Updating displays after background operations complete
* Synchronizing UI state with external events
* Manual refresh triggers for complex state dependencies

***

#### ⚙️ Default Behavior

By default:

| Behavior        | Description                                          |
| --------------- | ---------------------------------------------------- |
| **Scope**       | Rebuilds current page/component if no name specified |
| **Propagation** | Triggers listeners on the specified state context    |
| **UI Update**   | Forces dependent widgets to re-render                |
| **Performance** | Only rebuilds specified context, not entire app      |

***

#### 🛠️ How to Use

<figure><img src="https://3626461507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbhApDTL7kHrXte2TTtjs%2Fuploads%2Fgit-blob-00d13c563a153bc29671fa51cfd545515b2af0f1%2Frebuild_state_action.png?alt=media" alt="Call External Method action configuration showing message name and payload fields"><figcaption><p>Call External Method action configuration in Digia Studio</p></figcaption></figure>

1. Add the action to a widget event (e.g., onClick, onChanged)
2. Choose **Rebuild State** from the action list
3. Specify `stateContextName` to target a specific state context

***
