3 consecutive enum inputs hide results but still log into Google sheet

Hello,

I have 3 consecutive enum inputs as below:

1. [GoExecise]

"Yes", "No", "Not Sure"

2. [Where]          show if : [GoExecise]="Yes"

"Sea side", "Play ground", "Hiking"

3. [When]          show if : AND([GoExecise]="Yes",[Where]<>"")

"Immediately", "Tonight", "Tomorrow"

The logic above if [GoExecise] is "Yes", [Where] will show for choice. If[GoExecise] is "No" or "Not Sure", [Where] & [When] will not show in appsheet.

My question is if someone clicks [GoExecise] for "Yes", then choose[Where] "Sea side" & [When] "Immediately". And then click [GoExecise] for "No" to hide[Where] & [When].

The result of Google sheet will be [GoExecise] "No",  [Where] "Sea side" & [When] "Immediately" !!! How can I erase [Where] "Sea side" [When] "Immediately" after clicking [GoExecise] "No"? Thanks

Solved Solved
0 2 70
1 ACCEPTED SOLUTION

Assuming user is filling up the fields in a form view, please try in the valid_if of [Where] an expression something like

SWITCH([GoExecise], 

                     "Yes" , LIST("Sea side", "Play ground", "Hiking"),

                       "No", LIST(""),

                        "Not Sure", LIST(""), 

                         LIST(""))

Please try in the valid_if of [When] an expression something like 

IF(  AND( ISNOTBLANK([Where]) , [GoExecise] ="Yes"),

                 LIST("Immediately", "Tonight", "Tomorrow"), LIST(""))

The above approach will need user to change values of [Where] and [When] when she/he changes value of [GoExecise]

Another approach could be to use even actions on form save with the above expressions to set the values of [When] and [Where] to blank when form is saved with [GoExecise] is "No" or "Not Sure"

View solution in original post

2 REPLIES 2

Assuming user is filling up the fields in a form view, please try in the valid_if of [Where] an expression something like

SWITCH([GoExecise], 

                     "Yes" , LIST("Sea side", "Play ground", "Hiking"),

                       "No", LIST(""),

                        "Not Sure", LIST(""), 

                         LIST(""))

Please try in the valid_if of [When] an expression something like 

IF(  AND( ISNOTBLANK([Where]) , [GoExecise] ="Yes"),

                 LIST("Immediately", "Tonight", "Tomorrow"), LIST(""))

The above approach will need user to change values of [Where] and [When] when she/he changes value of [GoExecise]

Another approach could be to use even actions on form save with the above expressions to set the values of [When] and [Where] to blank when form is saved with [GoExecise] is "No" or "Not Sure"

Thank you Suvrutt_Gurjar, you saved me a day. I didn't know Switch function before..

Top Labels in this Space