Of course you can use a collection, if you have a key to retrieve your checkbox without confusion.
If I were to elaborate:
1. You're populating your dropdown with "Choices()" by default
Choices(
source.column
)
2. To filter the items returned from "Choices()", you nest the function in "Filter()"
Filter(
Choices(...),
true //This will return all records from the filtered source. Basically no filter applied.
)
3. But "Filter()" need conditions to select which records can stay and which records must be removed from the selection
Filter(
Choices(...),
Value = "value" //Select all records from Choices(...) where the value is equal to "value"
)
4. You fill in the condition with the checkboxes you check or uncheck
Filter(
Choices(...),
checkbox.Value, //If you checkbox is checked, return true
)
I'm guessing you've stored your checkbox in a collection with a name to easily recognize them, so you could use "LookUp()" to get the checkbox from the collection like this:
LookUp(
collection,
key = "value" //return the checkox whose key is equal to "value"
)
For example, the table below:
| Key |
Check1 |
Check2 |
Check3 |
| A |
X |
|
|
| B |
|
X |
|
| C |
X |
|
X |
| D |
|
|
X |
"Key" is a text column, while other columns are boolean.
The following formulas would return those results:
Filter(
table,
Or(
Check1 = checkbox1.Value,
Check2 = checkbox2.Value,
Check3 = checkbox3.Value
)
)
| Checkboxes |
Returned records |
| Checkbox1 checked |
[ A ; C ] |
| Checkbox2 checked |
[ B ] |
| Checkbox3 checked |
[ C ; D ] |
Hope this was helpful to you.