# 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="https://3626461507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbhApDTL7kHrXte2TTtjs%2Fuploads%2Fgit-blob-cb36dab780dc0cd1f40f86af4597a507cbd2783a%2Fpop_action.png?alt=media" 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](https://docs.digia.tech/logic-and-interaction/actions/go-to-page) - 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*
