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 / Removing items from ga...
Power Apps
Unanswered

Removing items from gallery using checkboxes and a button control

(0) ShareShare
ReportReport
Posted on by 2

Hi,

 

I am new to Powerapps and have taken over the administration of one of our companies' programs. I am trying to implement a way of removing certain items from a document library ('PI Supporting Images') by using a checkbox control within the gallery that displays these items ('D2SupportImagesGallery'). The document library contains images relating to a certain product issue, which are uploaded by the user within the app. The ID term relates to the ID of the currently selected product issue (in this case the ID is 485).

 

Currently there is no way to remove images from this library from the app. I have found a way of deleting the most recent picture that has been uploaded by using the following code within the 'OnSelect' section of the button (the trash icon): 

 

 

Remove('PI Supporting Images',LookUp('PI Supporting Images',ID=D2SupportImagesGallery.Selected.ID))

 

 

I want to improve this functionality by allowing the user to select which specific images they want to remove using a check box control ('D2DeleteImageCheckbox'). If the check-box is ticked, I want those items to be deleted when the delete button is pressed. However, I cannot figure out how to implement this feature within the code in the "image deletion" button. Do I need any code within the "OnChecked" items of the checkboxes? In pseudocode, I just want something like "if checkbox is ticked, remove these items from the gallery" as it is currently done. I feel like this should be a very simple alteration to the current code, yet I cannot figure a solution out (I have found related threads to this issue including this one but have had no luck with it so far). 

 

Many thanks for any help.

 

gallerysnip.png

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @matt_m23 

    Yes, this can easily be done in PowerApps, but I have a question for you.

    Are you stating that you just want to have checkboxes next to the file/image to mark it to be deleted, or are you stating that you want some sort of "out of the gallery" way to identify files/images of certain types to delete?

     

    Both would have different approaches, but this is easily done from the Gallery and there is no actions or other supporting factors needed.  

     

  • matt_m23 Profile Picture
    2 on at

    Hi Randy,

     

    Yes, I want the checkbox to be part of the gallery, then use a separate button outside the gallery (the trash icon in the screenshot) which deletes all checked gallery items from the document library. I have already implemented the checkbox as a gallery item (see screenshots in the OP and below), which sits in line with the images and captions. 

     

    gallerylist.png

  • GKAV Profile Picture
    2 on at

    How do I Configure the OnSelect Bin Icon to remove an attachment in a single record. I can only remove the attachment from the Attachment Data CardRemove Attach Qry.jpg

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard