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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Delete image from both...
Power Apps
Unanswered

Delete image from both a collection and SP attachment

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I'm using a form, MyForm, from which a user can take pics that will be saved as attachments.

 

For that i've set up a Camera that, upon clicking on it, will "save" - Collect() - the picture(s) in a collection named Collection1.

I've put a gallery, Gallery1, which is displaying the images from that Collection1.

In that gallery there's a trash icon which appear on each pictures, with OnSelect set to

 

RemoveIf(Collection1;DisplayName= ThisItem.DisplayName)

 

In that form, i've got a hidden attachments card and its update set to Collection1, in order to save all the pictures from Collection1 to the attachments column in the SPlist.

 

If this is the first time i take pics (no saved attachments yet that is), the trash icon delete the chosen images and upon hitting the form save button - SubmitForm(MyForm) - all the remaining images are saved as attachments in SP.

 

==>

 

After all that i'd like to be able to delete some or all images when i go into EditForm(MyForm).

 

The trash button on each images still delete that image in Collection1 but that doesn't delete the attachment when hitting the SubmitForm(MyForm) button.

The cross button of the image in the attachment field does nothing as well when i hit the SubmitForm(MyForm) button.

 

I tried to set the OnSelect of the trash button as 

RemoveIf(Collection1;DisplayName= ThisItem.DisplayName);; Remove(MySPlist; Lookup(MySPlist; ID = ThisItem.DisplayName))

but it doesn't like the Lookup(MySPlist; ID = ThisItem.DisplayName) part.

 

QUESTION :

 

How will i be able to delete an image from both the collection and attachments ?

 

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

    Hi @dunnno ,

     

    Do you want to remove attachments from the Sharepoint list in Power Apps?

    Here are some links that might help you:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Delete-a-specific-attachment-in-a-sharepoint-list/td-p/489787

    https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-delete-attachment-in-sharepoint-item/m-p/1267633

     

    Best Regards,

    Charlie Choi

  • dunnno Profile Picture
    on at

    Hi,

     

    The problem here is that the Attachments datacard is populated by the images in the collection, then the update of the datacard send those images to the attachments of the SP list item.

    That means that i never see in my form the actual attached files.

     

    I can delete an / or all images from the collection but it won't remove it / or them from the SP list item attachments storage.

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 248 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 209 Super User 2026 Season 1

#3
VASANTH KUMAR BALMADI Profile Picture

VASANTH KUMAR BALMADI 195

Last 30 days Overall leaderboard