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 ?
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.
Hi @dunnno ,
Do you want to remove attachments from the Sharepoint list in Power Apps?
Here are some links that might help you:
Best Regards,
Charlie Choi