Hi Community!
I am facing an issue related to the use of a Select All checkbox to add all items in a Gallery to my collection. The collection is based on a couple of slicers I have, and I would like this Select All checkbox to add all the current items in the Gallery to my collection.
The problem is however that the Select All box currently adds all items in the Gallery, despite the current selection already made and the items that are already present in the collection. This means that if an item is already selected or present in the collection, it is duplicated in the collection.
I would like to avoid this by building in the logic that only the items are added which arent already in the collection. Do anyone have any tips on how to achieve this? Thanks for the help in advance!
Overview

Select All OnCheck
UpdateContext({CheckCheckbox:true});ForAll(Collect(SelectedBudgetOwners,GalleryBudgetOwners.AllItems),ThisRecord)
Select All OnUncheck (this removes all items in the gallery)
Remove(SelectedBudgetOwners, GalleryBudgetOwners.AllItems); UpdateContext({CheckCheckbox:false});
CheckBox Default
CheckCheckbox
CheckBox OnCheck
Collect(SelectedBudgetOwners, ThisItem)
CheckBox OnUncheck
Remove(SelectedBudgetOwners, ThisItem)