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

Delete an attachment in gallery - CDS

Anyone know what OnSelect code I use to delete an attachment from a Gallery in a Canvas App? The backend tables are in CDS.

I am trying with this code but nothing is happening: Remove(BrowseGallery1.Selected.'{Attachments}',ThisItem)

Boppersnr1_0-1659710542581.pngBoppersnr1_1-1659710554691.png

 

 

6 REPLIES 6
rampprakash
Super User
Super User

Hi @Boppersnr1 

 

Please try below code

 

Remove(Notes,LookUp(Notes,Note=ThisItem.Note

@rampprakash Afraid I do not have a collection called Notes or any other collection for the attachments. I was looking to delete the attachments directly from the attachment control / database.

Boppersnr1_0-1659784789986.png

I also tried this but no joy:

Remove(BrowseGallery1.Selected.'{Attachments}',LookUp(BrowseGallery1.Selected.'{Attachments}'.Value=ThisItem.Value)

Boppersnr1_1-1659785004047.png

 

Hi @Boppersnr1 

 

Add a DataSource Notes and try again.

@rampprakash 

Is this what you mean:

Remove('Customer Site Surveys'.Notes,LookUp('Customer Site Surveys'.Notes,Note=ThisItem.Note))

Afraid that didnt work:

Boppersnr1_0-1659895664328.png

 

Hi   

Use below Code

 

Remove(Notes,LookUp(Notes,Note=ThisItem.Note)

 

Add Notes as DataSource

 

@Boppersnr1

@rampprakash I get these errors:

Boppersnr1_0-1659896472990.pngBoppersnr1_1-1659896527949.png

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,152)