Good day everyone.
I am struggling.
I have 2 ways for users to add attachments to an email.
Option 1:
I have an attachment control where users can add attachments, which are then saved in a collection and later send as email attachments.
Right now it is possible to add the same file multiple times.

I want to prohibit this.
The collection is updated everytime a new file gets added, this is what I tried:
Batchmail_attachment (Attachment Viewer)
OnAddFile:
If(CountRows(Filter(colAttachments,DisplayName = ThisRecord.DisplayName))>1,
Notify("No Duplicates allowed"),
Collect(colAttachments,Self.Attachments)
)
Items:
This does not work however, you can still add the same file multiple times.
Option 2:
Users can add previously saved attachments via checkboxes. These checkboxes also add the attachment to the same collection.
CheckboxCanvas1
OnCheck:
If(CountRows(Filter(colAttachments,DisplayName = ThisRecord.DisplayName))>1,
Notify("No Duplicates allowed"),
Collect(colAttachments,ThisItem.Attachments)
));
This also does not work, you can still add the same file multiple times and for some reason can only add a maximum of 2 files, even though the maximum number of attachments is 10.

Any help is welcome
Thank you
Nick