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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Delete record from col...
Power Apps
Answered

Delete record from collection

(0) ShareShare
ReportReport
Posted on by 74

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? 

Categories:
I have the same question (0)
  • Verified answer
    v-micsh-msft Profile Picture
    Microsoft Employee on at

    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

  • ldurland Profile Picture
    74 on at

    yes this appears to be working. Thank-you

  • Conor-Clements Profile Picture
    6 on at

    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?

  • BG103 Profile Picture
    3 on at

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

  • tourbillon Profile Picture
    4 on at

    Try this one :

    Remove('collection name', ThisItem)

    it works 😉

  • anupam-pratihar Profile Picture
    2 on at

    For deleting individual record from the gallery, this code 

    Remove('collection name', ThisItem)

    gives me an error. It seems like it is unable to fetch ThisItem(showing not recognised)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard