cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Cec123
Regular Visitor

Delete and move records

I have a "delete" button and I want to allow the user to click "delete" and the row is removed from the gallery table on the front end , but stored in a table on the backend in an "Inactive" column. I don't actually want the user to delete rows. How do I go about this.

3 REPLIES 3
Pstork1
Dual Super User
Dual Super User

Add an inactive column to the data source and filter the Gallery to only show records where the Inactive column does not equal "Inactive".  When a user presses the delete button Patch the selected item and set the Inactive column to "Inactive"



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Cec123
Regular Visitor

How would I write the Patch function?

Pstork1
Dual Super User
Dual Super User

Assuming that you want the selected record in the gallery to be the one that is marked inactive.  The Title field is included because its a required field.  Make sure to include the current values of any other required fields too.

Patch(datasourcename, galleryname.Selected,{Title: <<current title>>, Inactive: "Incative"})

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,412)