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

Notifications

Announcements

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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard