# Pop

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

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

The **Pop Page** action navigates backward in the app's navigation stack, closing the current page/screen and returning to the previous one. This is the standard way to implement "back" functionality in mobile apps.

***

#### 📦 Properties

| Property | Type             | Required | Description                                               |
| -------- | ---------------- | -------- | --------------------------------------------------------- |
| `maybe`  | Boolean          | ❌        | If `true`, safely attempts to pop without throwing errors |
| `result` | Expression (Any) | ❌        | Data to pass back to the previous screen                  |

***

#### ✅ Common Use Cases

* Closing detail screens and returning to list views
* Dismissing modal dialogs or bottom sheets
* Navigating back after completing forms or tasks
* Implementing cancel/back buttons in workflows
* Returning from settings or configuration screens

***

#### ⚙️ Default Behavior

By default:

| Behavior              | Description                                                  |
| --------------------- | ------------------------------------------------------------ |
| **Navigation Safety** | Uses standard `Navigator.pop()` - throws error if cannot pop |
| **Result Passing**    | No result data is passed back to the previous screen         |
| **Stack Management**  | Removes current route from navigation stack                  |
| **Animation**         | Uses platform default back transition animation              |

***

#### 🛠️ How to Use

<figure><img src="/files/GTgA8OvbGoNPSOLWpu2c" alt="Copy Slugs"><figcaption><p>Copy Slug</p></figcaption></figure>

1. Add the action to a widget event (e.g., back button, cancel button)
2. Choose **Pop Page** from the action list
3. Optionally configure `maybe` for safe popping or `result` to pass data back

***

#### 🔄 Result Handling

When popping with a `result`, the data is passed back to the previous screen. This is commonly used with the **Go To Page** action's `Expect Result` and `onResult` properties.

**Result Structure:**

```javascript
{
  "data": <your-result-value>
}
```

***

{% embed url="<https://digiaacademy.portal.trainn.co/share/pop-examples>" %}

***

#### 🔗 Related Documentation

* [Go To Page](/logic-and-interaction/actions/go-to-page.md) - Navigate to pages with result handling
* [Finding Page/Component Slugs](https://github.com/Digia-Technology-Private-Limited/digiaDocs/blob/main/platform-overview/builder-tool/finding-slugs.md) - Understanding page identifiers for navigation

***

*Asset Placeholder: Tutorial video demonstrating back navigation and result passing in Digia Studio*


---

# 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/pop.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.
