cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

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