Can an expression clear a dropdown value if the referring checkbox is unselected? | Community
Skip to main content
Lyndsy-Denk
Level 3
Nov 26, 2024 4:50 PM UTC
Question

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

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

skyehansen
Level 4
Nov 26, 2024 6:06 PM UTC

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

Translate
Lyndsy-Denk
Level 3
Dec 2, 2024 4:24 PM UTC

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

Translate
skyehansen
Level 4
Dec 2, 2024 5:17 PM UTC

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.

Translate