I was able to get this to work using a collection which gets loaded with the attachments on a gallery item select, then if an attachment is removed from the attachments control, using the OnRemoveFile event, I compare the collection I filled previously to whats left in the attachments control and then store the name of the file missing / removed in another collection.
The name of my collection to compare is colAttachments
// gallery OnSelect event
If(
ThisItem.'Has attachments' = true,
ClearCollect(
colAttachments,
ThisItem.Attachments
);
,
ClearCollect(
colAttachments,
Blank()
)
);
// Attachments (DataCardValue19) OnRemoveFile event
// stores our removed document
ClearCollect(
colRemovedAttachments,
Blank()
);
// loop our originally set colAttachments
ForAll(
colAttachments,
If(
!(colAttachments[@Name] in DataCardValue19.Attachments.Name),
Collect(
colRemovedAttachments,
colAttachments[@Name]
);
);
);
// reset collection for other removals
ClearCollect (
colAttachments,
DataCardValue19.Attachments
);