Calculate value ignoring row selection in gallery
Hello everyone, I have a checklist gallery where what I want is that the answer combination generates a note for me I did the logic below, but when clicking on a specific line in the gallery and clicking on the "generate note" button, the formula only takes that line into account, but what I want is to consider all the fillings
Code:
Set(
Resultado;
Switch(
true;
CountIf(
Gallery1.AllItems;
ComboBox1.Selected.Value = "NÃO" && Text(Subtitle1) = "1"
) > 0;
0;
CountIf(
Gallery1.AllItems;
ComboBox1.Selected.Value = "NÃO" && Text(Subtitle1) = "2"
) > 0;
1;
CountIf(
Gallery1.AllItems;
ComboBox1.Selected.Value = "NÃO" && Text(Subtitle1) = "3"
) > 0;
2;
CountIf(
Gallery1.AllItems;
ComboBox1.Selected.Value = "NÃO" && Text(Subtitle1) = "4"
) > 0;
3;
true;
4
)
)