Expand my Community achievements bar.

Can an expression clear a dropdown value if the referring checkbox is unselected?

Avatar

Level 9

I'm building a custom form that starts with a checkbox field. Upon selecting an item, it shows a single-select dropdown listing numbers. Then I have a calculation that says, "Sum the value of all those number dropdowns." However, if you deselect an item in the checkbox, it doesn't clear the dropdown value and the calculation is therefore inaccurate. I'm thinking there are two possible workarounds, but I'm struggling to take my thinking further:

  1. Write an expression to clear the dropdown value if the checkbox is deselected.
  2. In my SUM expression, only sum if the checkbox is also selected.

I'd prefer option 1, but I suspect option 2 is more feasible. What do you think?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

3 Replies

Avatar

Community Advisor

option 2 all the way, as well as figuring out other risks of having a hidden, selected dropdown field.

Avatar

Level 9

Thank you for validating. Now I have to figure out the if statements, which make my head spin.

Avatar

Community Advisor

have you tried chatGPT? If you give it a sample of a simple IF statement, I bet you can get it to help you on something more difficult.