Hello everyone,
- Background: I have been working on a PowerApp where there is a gallery, and on select of a button in the gallery I am opening a Form in Edit mode that corresponds to a SharePoint list item. I am leveraging this form's attachment control to save pictures taken from Camera control.



- Issue: Deleting an Item does not actually deletes the item from the attachment rather creates duplicate of all other images except the one being deleted. I know if I make the attachments control visible then a user will be able to delete it directly from the control, but I want to achieve this using my delete button (through pfx).
- Code:
ClearCollect(colAttachments,ThisItem.Attachments)
Collect(
colAttachments,
{
DisplayName: "CaptureImage - " & GUID() & ".jpg",
Id: "CaptureImage - " & GUID() & ".jpg",
Value: Camera1.Photo,
RowID: ThisItem.ID
}
);
Reset(DataCardValue29);
SubmitForm(Form3);
Set(
varSpinner,
false
);
Refresh('Inspection Questions')​
RemoveIf(colAttachments,Id=ThisItem.Id);Select(Icon5)​
Reset(DataCardValue29);SubmitForm(Form3);​