---
title: "Power Apps 101: Deleting Records in Canvas Apps"
description: Learn how to delete records in Canvas Apps safely with a confirmation screen. Prevent accidental data loss using contextual variables and visibility controls.
---

[Pragmatic Works Nerd News ](https://pragmaticworks.com/blog)

# [Power Apps 101: Deleting Records in Canvas Apps](https://pragmaticworks.com/blog/power-apps-101-deleting-records-in-canvas-apps)

 Written by [Matt Peterson](https://pragmaticworks.com/blog/author/matt-peterson) | Apr 25, 2026

In a recent episode of Power Apps 101 from Pragmatic Works, the focus was on deleting records in Canvas Apps while ensuring proper user confirmation to prevent accidental data loss.

 

 

#### Deleting Records the Simple Way

The simplest way to delete a record in a Canvas App involves using the `Remove()` function. The tutorial demonstrates how to:

- Add a trash can icon.
- Set the `OnSelect` property to: `Remove(PTORequestTable, ThisItem)`.
- Test the deletion with a click on the icon.

However, this basic method permanently deletes the data without confirmation, which can lead to unintentional loss.

#### Adding a Confirmation Screen

To safeguard against accidental deletion, the video explains how to create a confirmation screen with a user prompt before data removal.

**Steps to Create the Confirmation Screen:**

1. **Add a Container:** Insert a free-flowing container for flexibility.
2. **Customize Visibility:** Rename the container `CNT_ConfirmDelete` and adjust its fill color for visibility.
3. **Add Text and Buttons:** Insert a label with a confirmation message and two buttons: "Confirm" (green) and "Cancel" (red).

#### Managing Visibility with Contextual Variables

The visibility of the confirmation screen is controlled using a **contextual variable**. The tutorial explains how to:

- Use the `UpdateContext` function to manage the variable.
- Set the variable `VarShowConfirmScreen` to `false` by default in the screen's `OnVisible` property.
- Update the variable to `true` when the trash icon is clicked.
- Control the visibility property of the container using the variable.

#### Cancel Button Functionality

The `Cancel` button hides the confirmation screen by resetting the variable back to `false`:

```
UpdateContext({VarShowConfirmScreen: false})
```

#### Confirm Button Setup and Deleting the Record

The confirm button needs to both delete the record and hide the confirmation screen. To achieve this:

- Use `UpdateContext` to reset the variable.
- Use `Remove()` to delete the record:

```
UpdateContext({VarShowConfirmScreen: false});
Remove(PTORequestTable, Gal_PTORequest.Selected)
```

**Key Consideration:** The `Selected` property is used instead of `ThisItem` because the container doesn't hold the original record directly.

#### Final Testing and Results

By following these steps, the confirmation screen properly appears when the trash icon is clicked. The user can choose to cancel or confirm deletion, ensuring better data protection.

#### Key Takeaways:

- Use the `Remove()` function for direct deletion.
- Implement a confirmation screen using contextual variables.
- Control visibility with the `Visible` property and variables.
- Ensure both deletion and screen hiding occur when confirming.

Don't forget to check out the [Pragmatic Works' on-demand learning platform](https://learning.pragmaticworkstraining.com/freeTrial/MarketingSiteODLTrial) for more insightful content and training sessions on Power Apps and other Microsoft applications. Be sure to subscribe to the [Pragmatic Works YouTube channel](https://www.youtube.com/pragmaticworks?sub_confirmation=1) to stay up-to-date on the latest tips and tricks.

[View full post](https://pragmaticworks.com/blog/power-apps-101-deleting-records-in-canvas-apps)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Matt Peterson"
  },
  "dateModified" : "2026-04-25T17:34:01.690Z",
  "datePublished" : "2026-04-25T17:34:01Z",
  "headline" : "Power Apps 101: Deleting Records in Canvas Apps",
  "image" : {
    "@type" : "ImageObject",
    "height" : 180,
    "url" : "https://blog.pragmaticworks.com/hubfs/Blogimage-Jan-06-2025-09-22-56-4929-PM.jpeg",
    "width" : 320
  },
  "mainEntityOfPage" : "https://pragmaticworks.com/blog/power-apps-101-deleting-records-in-canvas-apps",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60.0,
      "url" : "https://blog.pragmaticworks.com/hubfs/PW%20Logo-2.png",
      "width" : 217.56097
    },
    "name" : "Pragmatic Works Blog"
  }
}
```