Allways set one field dependant of the other field

Hello,
i often have the same issue regarding workflow: how to set one field dependant on some other field and update that field when 1st field changes.
For (very simplified) example: I have a field with 2 buttons, (let’s say “1” and “2”) and another field with buttons “A” and “B”
I want to achieve the following:
If “1” is selected do not show 2nd field and automatically select “A”
If “2” is selected then show 2nd field and allow user to select “A” or “B”
i know how to show/hide 2nd “A”/“B” buttons and how to use Initial value formula, but the problem is when users choose “2”, then “B”,
then goes back to selecting “1” and now 2nd field (“A”/“B” buttons) is hidden but it contains “B” which it shouldn’t if “1” is selected.
I’m solving this with On Save Action and setting 2nd field to “A” if 1s field contains “1” but i wonder if there is any more elegant solution?

Thank you for ideas and best regards,
Peter

Solved Solved
0 3 193
1 ACCEPTED SOLUTION

Once a value is manually entered into a field during a Form session, Initial Value will stop evaluating. Getting around this in circumstances like yours will just come down to exactly how you want it to work. One suggestion would be make the first column un-editable once a value has been selected in it.

editable_if = ISBLANK( [_THIS] )

Another option might be to have a separate hidden field for the “final” value of the second column that is just calculated by expression, such as:

IF(
  [col1] = 1 ,
  "A" ,
  [col2]
)

Your described Form Save Action is another appropriate option.

View solution in original post

3 REPLIES 3

Use an app formula; as in:

SWITCH([Column1],
  1,  "A",
  2,  "B",
"")

to set the value of the column you wish… and use a show if to hide the 2nd field.

[Column1] = 1

This would set Column2 to “B” if “2” is selected in Column1, however i don’t want that. I want for user to be able to select between “A” in “B” (buttons) if “2” is selected,.

Once a value is manually entered into a field during a Form session, Initial Value will stop evaluating. Getting around this in circumstances like yours will just come down to exactly how you want it to work. One suggestion would be make the first column un-editable once a value has been selected in it.

editable_if = ISBLANK( [_THIS] )

Another option might be to have a separate hidden field for the “final” value of the second column that is just calculated by expression, such as:

IF(
  [col1] = 1 ,
  "A" ,
  [col2]
)

Your described Form Save Action is another appropriate option.

Top Labels in this Space