Question

How do I change the value of an choice box based on the value of another choice button


Badge +4

I have 2 choice options rendered as buttons on a responsive form that I would like to have the first choice option remove the value in the second option button if a specific value is chosen.  I normally do this via the rules, but for some reason, the “Then” drop down on the rule only has the options of Disable, Hide and Invalidate.  Is there another way of doing this on a responsive form?


5 replies

Userlevel 2
Badge +6

I don't think this is directly possible in responsive. But you can circumvent it with a form variable.

Let's say your first choice option has options Yellow, Green, or Blue, and you want to fix your second option (say to Apple) if Green is selected for the first option. You could make a form variable with the formula:

if(equals(Choice1,”Green”),”Apple”,Choice2)

The things I coloured red are control elements you can select in the formula builder. Now, to make this meaningful, instead of linking Choice2 directly to whatever column you want to write this to, you instead link this form variable to that column. To do this, make sure that the Choice2 column on the list is actually set as a single line text column (not a choice column). You can still use a choice control for Choice2 on the Nintex form, you just don’t link it directly to the list, it’s only linked indirectly through the form variable. 

To make it more elegant, you probably want to hide the Choice2 control on the form if the option for it is fixed by Choice1 so users don’t get mistaken believing they still have to enter something there, you can do this through rules.

Badge +4

I don't think this is directly possible in responsive. But you can circumvent it with a form variable.

Let's say your first choice option has options Yellow, Green, or Blue, and you want to fix your second option (say to Apple) if Green is selected for the first option. You could make a form variable with the formula:

if(equals(Choice1,”Green”),”Apple”,Choice2)

The things I coloured red are control elements you can select in the formula builder. Now, to make this meaningful, instead of linking Choice2 directly to whatever column you want to write this to, you instead link this form variable to that column. To do this, make sure that the Choice2 column on the list is actually set as a single line text column (not a choice column). You can still use a choice control for Choice2 on the Nintex form, you just don’t link it directly to the list, it’s only linked indirectly through the form variable. 

To make it more elegant, you probably want to hide the Choice2 control on the form if the option for it is fixed by Choice1 so users don’t get mistaken believing they still have to enter something there, you can do this through rules.

Thanks, do i put that formula into the “When” section of the rule? What do i put for the “Then” formula?  The second choice value is already hidden when the first choice is changed, but as it’s still selected when it’s hidden, there’s a rule that stops the form from being sent if this option is select.

 

E.g. What i’m wanting to happen is as follows:

Choice1 has A and B as options.  If option B is selected, then Choice2 is hidden and defaulted back to blank, so that the rule is not invoked forcing users to complete a different section (that’s hidden).

Userlevel 2
Badge +6

The formula is the formula to define the form variable. Form variables are essentially just calculated values that aren’t directly displayed on the nintex form. If you want to make Choice2 blank when Choice1 is B, you’d probably use as a form variable:

if(equals(Choice1,”B”),””,Choice2)

and connect that to the choice2 output column (and you leave the “Connect to” on the Choice2 field blank).

If you want to hide a section if Choice1 is B, you could use a rule that hides with the formula equals(Choice1,”B”)

You can also let it start hidden by default and only display once the user selects A, then you’d use the rule

not(equals(Choice1,”A”))

Badge +4

The formula is the formula to define the form variable. Form variables are essentially just calculated values that aren’t directly displayed on the nintex form. If you want to make Choice2 blank when Choice1 is B, you’d probably use as a form variable:

if(equals(Choice1,”B”),””,Choice2)

and connect that to the choice2 output column (and you leave the “Connect to” on the Choice2 field blank).

If you want to hide a section if Choice1 is B, you could use a rule that hides with the formula equals(Choice1,”B”)

You can also let it start hidden by default and only display once the user selects A, then you’d use the rule

not(equals(Choice1,”A”))

I’ve added a form variable and connected it to the Choice2 field, but when i preview the form and test it, the choice button still stays as selected.  Choice 2 has 2 options which are Yes and No, both columns are single line of text, so not sure what I’m doing wrong.

Userlevel 2
Badge +6

If the Choice2 field on the Nintex form isn’t connected directly to the list it will not write anything to the list when the form is submitted. You can just hide it with a rule if Choice1 equals B. It’s the form variable that should write to the list, not the choice2 field itself.

Reply