Hi @AliciaDG,
Could you please share more detail on your scenario? What is the Items property of Gallery?
I made a test demo for your case, hope this helps.
Add a new column "Selected?" to the data source of Gallery to store the selection of check box for each items
ClearCollect(myCol,AddColumns('SP list',"Selected?",false)) //App.OnStart or Screen.OnVisible.
Set Gallery.Items property as follows to filter out these checked items.
Filter(myCol,!'Selected?')
Configure Main check box as follows to control all sub check boxes.
UpdateIf(myCol,true,{'Selected?':false}) //OnUncheck property
UpdateIf(myCol,ID in GalleryName.AllItems.ID,{'Selected?':true})//OnCheck property
Configure sub check box as follows.
ThisItem.'Selected?' //Default property
Patch(myCol,ThisItem,{'Selected?':true})//OnCheck property
Patch(col2,ThisItem,{'Selected?':false})//OnUncheck property

Sik