web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Form deletion function...
Power Apps
Suggested Answer

Form deletion function (I want to display the deleted text in the gallery)

(0) ShareShare
ReportReport
Posted on by
I'm a beginner. Sorry for the poor explanation.
 
If you press the "Delete" button on the form selected in the gallery,
Instead of being removed from the SPO list, I want to display "Deleted" in the corresponding list in the gallery.
If you know how to write a function for the button to delete, please let me know.
Best regards.
I have the same question (0)
  • Suggested answer
    SwatiSTW Profile Picture
    741 Super User 2025 Season 2 on at
    1. Add a column named Status in your SharePoint list. Make it a Single line of text or Choice column.
    2. Update the Items property of the gallery:
        Filter(SPOListName, Status <> "Deleted")
        
    3. For the "Delete" button, set the OnSelect property to:
        Patch(
            SPOListName,
            ThisItem,
            {Status: "Deleted"}
        );
        Notify("Item marked as deleted", NotificationType.Success);
        
    4. The gallery will now show only items where Status is not "Deleted."
    5. If you want, you can add a "Restore" button for deleted items and set its OnSelect property to:
        Patch(
            SPOListName,
            ThisItem,
            {Status: ""}
        );
        Notify("Item restored", NotificationType.Success);
  • Suggested answer
    Garima_PowerPlatform Profile Picture
    170 on at
    Hi,
     

    Steps for Deleting an Item:

    1. Add a Delete Button:

      • Add a Delete button next to each item in the gallery.
    2. Set the Button's Action:

      • On the button's OnSelect property, write a formula to remove the selected item from your SharePoint list.
       
      Remove(
      SharePointList,
      Gallery.Selected
      )
    3. Update the Gallery:

      • After deleting, you want the gallery to reflect the deletion by displaying "Deleted" or filtering out the deleted items.
       
      ClearCollect(
      UpdatedGallery,
      Filter(
      SharePointList,
      IsBlank(DeletedColumn)
      )
      )
    4. Display Deleted Status:

      • In the gallery, you can show a status (like "Deleted") for items that are no longer active.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard