Hi all,
I have a Checkbox gallery that is automatically set to all checked if a certain value of dropdown is selected. However, whenever I try to uncheck items and add to the collection, the checkbox checked all the items and add to the gallery. I couldn't uncheck item that I don't need from the gallery. Here are the logic that I set for my buttons, checkbox and gallery.
Checkbox property:
Default = If(DataCardValue1.Selected.Value = 'TableDropdownName''.Yes, true,false)
OnCheck = Collect(Collection,ThisItem)
OnUncheck = Remove(Collection,ThisItem)
I also have a Clear button and Add to Collection button that let users to uncheck the checkbox before adding to collection.
Clear button:
If(DataCardValue11.Selected.Value = 'TableDropdownName'.Yes Or DataCardValue1.Selected.Value = 'TableDropdownName'.No, true, false)
Add to Collection button:
UpdateContext({varResetCheckbox:true});
UpdateContext({varResetCheckbox:false});
ForAll(Filter(Gallery.AllItems,Checkbox1.Value = true),
Collect(Collection,ThisRecord))