Hello @WorkingRicardo ,
I would recommend you import his code and try to see what he is doing, incase you are having difficulties you check below logic
I am not sure how your application is configured but i am adding Reza's Logic below :-
1) Creating Collections for Attachments
- Place this code in the OnSelect property of the Gallery to run when an item is selected.
It filters attachments starting with "Project" and "Travel". If you only need one type, adjust accordingly.
ClearCollect(colProjectAttachs, Filter(ThisItem.Attachments, StartsWith(DisplayName, "Project-"))); ClearCollect(colTravelAttachs, Filter(ThisItem.Attachments, StartsWith(DisplayName, "Travel-"))); ClearCollect(colFinalAttachments, ThisItem.Attachments);
2) Adding Attachment Controls to Your Form
- You'll need three controls: one for Project, one for Travel, and one combining all attachments.

Since you only need one extra attachment, you can skip the Travel attachment control.
3) Configuring the Project Attachment Control
- Set Items to colProjectAttachs
- For the OnAddFile, OnRemoveFile, and OnUndoRemoveFile events, Set
- Select(btnProject)
btnProject is a hidden button which we will talk about next

4)Setting up the btnProject button & project attachment datacard
OnSelect
ClearCollect(colProjectAttachs, DataCardValue7.Attachments); UpdateIf(colProjectAttachs, !StartsWith(DisplayName, "Project-"), { Name: "Project-" & Name, DisplayName: "Project-" & DisplayName }); RemoveIf(colFinalAttachments, "Project-" in DisplayName); Collect(colFinalAttachments, colProjectAttachs);
- Adjust the display name as needed.
- Ensure the attachment control's default property is blank
- For project attachment data card. Set the default to ThisItem.Attachments and Update to DataCardValue7.Attachment (here the datacardvalue7 is the project attachment control)
5) Configuring the combined attachment control
We come to the final step - there are many ways to manage this, reza is basically using this control only to display all the attachments, attachments cannot be added or removed

For the combined attachment Datacard set the following values :-
Default = ThisItem.Attachments
Update = DataCardValue9.Attachments
For the combined attachment control
Items = colFinalAttachments
Default = Blank
That's it ! Hope this helps
Cheers !