Hi @Dushy ,
No matter where the data comes from, you could use Gallery.AllItems.
You only need to ensure that the data type of the data is consistent.
I assume:
My data comes from sharepoint list.
I did the test for you:
1\ This is my list ‘LIST90’. ‘Test’ is a Single line of text column.

2\ Create a table ‘TEST 5’ in CDS. ‘Test2’ is a Text column.

3\ I save the value of the Title column in the list to the Name column in the CDS.
I save the value of the Test column in the list to the Test2 column in the CDS.
4\ Add a gallery control ‘Gallery2’ and set its Items property to:
LIST90
5\ Add a button control and set its onselect property to:
ForAll(Gallery2.AllItems,Patch('TEST 5',Defaults('TEST 5'),{Name:ThisRecord.Title,Test2:ThisRecord.Test}))
6\ The result is as follows:

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.