For example, if the user selects Question 1, then changes it again, the variable could be incremented again and give the wrong total.
Assuming each ComboBox only allows one selected value and the selected value is either "Yes" or "No", you can use this formula.
Set the same formula in the
OnChange property of each ComboBox:
With(
{
calcValue:
If(!IsBlank(cmbQuestionOne.Selected.Value), 1, 0) +
If(!IsBlank(cmbQuestionTwo.Selected.Value), 2, 0) +
If(!IsBlank(cmbQuestionThree.Selected.Value), 4, 0) +
If(!IsBlank(cmbQuestionFour.Selected.Value), 8, 0) +
If(!IsBlank(cmbQuestionFive.Selected.Value), 16, 0)
},
Set(varBinCalcCheck, calcValue);
If(
calcValue = 31,
Notify(
"All comboboxes have been answered",
NotificationType.Success
)
)
)
This works because:
- Question 1 answered = add
1
- Question 2 answered = add
2
- Question 3 answered = add
4
- Question 4 answered = add
8
- Question 5 answered = add
16
If all five are answered:
1 + 2 + 4 + 8 + 16 = 31
So varBinCalcCheck = 31 means all ComboBoxes have a value selected.
If this helped solve your issue, please Accept as Solution so others can find it quickly.
If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).