cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Delete record from collection

I can have a delete button in the gallery with the code below and it removes the local collection record no problem. 

remove(LocalDraft,Gallery3.Selected)

If however i add in a new validation screen to confirm deletion or UpdateContext variable on the same screen the code above never removes the record. 

 

on the new validation screen yes button to delete i have this.

Remove(LocalDraft,Gallery3.Selected);SaveData(LocalDraft,"LocalDraft");LoadData(LocalDraft,"LocalDraft");Navigate(OutBox,ScreenTransition.Fade)

anyideas why it is no working? 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Delete record from collection

Hi @ldurland,

 

Thanks for reporting this issue.

I tested the remove() function under another screen, It seems there is some problems when working with the Gallery.Selected record.

As a workaround, please take a try to match the proper record with the Data Source (or the collection) directly, for example:

 

Remove(Collection1,LookUp(Collection1,ID=Gallery1.Selected.ID))

Check to see if doing this would help.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Delete record from collection

Hi @ldurland,

 

Thanks for reporting this issue.

I tested the remove() function under another screen, It seems there is some problems when working with the Gallery.Selected record.

As a workaround, please take a try to match the proper record with the Data Source (or the collection) directly, for example:

 

Remove(Collection1,LookUp(Collection1,ID=Gallery1.Selected.ID))

Check to see if doing this would help.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Helper II
Helper II

Re: Delete record from collection

yes this appears to be working. Thank-you

Highlighted
New Member

Re: Delete record from collection

Hi,

 

I have noticed an issue with the work around

 

Remove(Collection1,LookUp(Collection1,ID=Gallery1.Selected.ID))

If the user clicks the button multiple times it will remove other records. Any idea when this will be looked at?

Highlighted
New Member

Re: Delete record from collection

OMG, I have searched forever to find a solution for this! Works perfectly!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,821)