Hello Team,
Here is what you need to do. Go ahead and add a check box to your Gallery control.
For the OnCheck property of Checkbox use the formula -
Collect(selected,{ID:ThisItem.Column3})

For the OnUnCheck property of Checkbox use the formula-
Remove(selected,{ID:ThisItem.Column3})

Then go ahead and configure a button and configure it as follows so that PowerApps passed the values of selected field as concatenated string to Flow -
IDGenerate.Run(Concat(selected,ID))

If you run the Power Apps, select the different check boxes and hit the button you get the different values -
(In my case, column 3 holds names of different persons so that has come up)
