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 192
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