# 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="/files/HmCAh0Bc0in7iiO539AS" 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

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digia.tech/logic-and-interaction/actions/rebuild-state.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
