cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to delete record from collection and the original datasource

Hello All!

 

I am currently trying to make an admin page for an application that I am building. I am trying to give the admin the privilege to delete a report if they choose to. 

 

To display the data in the gallery, I collected my data from Sharepoint List and put it into collection1.  I want the admin to be able to delete the item from the collection AND and the original item back in SharePoint. I am using the collection to avoid the 2000 item limit. 

 

Here is the formula that I tried but it is not working. Thank you!

 

Remove(Collection1, BrowseGallery2.Selected); Patch('Chhuns Test', Collection1); ClearCollect(Collection1, 'Chhuns Test'); Navigate(soradmin); UpdateContext({varShowPopup:false})

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: How to delete record from collection and the original datasource

You'll use a Remove statement to remove the record both from the collection and the datasource.  you don't need the patch statement at all.

Remove(Collection1, BrowseGallery2.Selected); Remove('Chhuns Test', Lookup('Chhuns Test', ID = BrowseGallery2.Selected.ID)); ClearCollect(Collection1, 'Chhuns Test'); Navigate(soradmin); UpdateContext({varShowPopup:false})

 

 



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

View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

Re: How to delete record from collection and the original datasource

You'll use a Remove statement to remove the record both from the collection and the datasource.  you don't need the patch statement at all.

Remove(Collection1, BrowseGallery2.Selected); Remove('Chhuns Test', Lookup('Chhuns Test', ID = BrowseGallery2.Selected.ID)); ClearCollect(Collection1, 'Chhuns Test'); Navigate(soradmin); UpdateContext({varShowPopup:false})

 

 



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

View solution in original post

Anonymous
Not applicable

Re: How to delete record from collection and the original datasource

Thank you so much!! I am still learning PowerApps! lol 🙂

Helpful resources

Announcements
thirdimage

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,096)