cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
chris_cannon
Nintex Newbie

Using Expression to Enable Form Field

Hello,

 

I have a form with a choice field (ex: Choice_Field with options "A" or "B").

 

If option "A" is selected I want the field, Optional_Field, to be enabled, and disabled when option "B" is selected.

 

I have been using an expression for the "Enabled" feature under Appearance for Optional_Field. The expressions I have attempted are the following:

 

fn-Equals(Choice_Field, "A")

Choice_Field == "A"

 

I have been adding Choice_Field to both expression attempts by typing out "Optional_Field" and also by selecting the field from Item Properties.

 

The result is the field never becomes enabled for either expression and regardless of how I add Choice_Field to the expression. Any suggestions would be greatly appreciated! Thanks.

Labels: (1)
0 Kudos
Reply
4 Replies
Automation Master
Automation Master

Re: Using Expression to Enable Form Field

Hi,

you shouldn't reference Choice_Field from Item Properties but from Named Controls because the one in Item Properties stores the value at the form load while the named one store the current value on the form..

 

Try to use the other reference and let us know if you can solve your issue

 

Giacomo

0 Kudos
Reply
chris_cannon
Nintex Newbie

Re: Using Expression to Enable Form Field

Hi Giacomo,

 

Thanks for your response.

 

I was thinking the same; however, named controls isn't an option here. In rules named controls are available, but in the field settings the named controls aren't there.

 

I have also tried doing this as a rule, but the rule has not worked out as desired despite disabling the field properly.

0 Kudos
Reply
Nintex Employee
Nintex Employee

Re: Using Expression to Enable Form Field

Hi,

As you have found you cannot reference a named control in the expression section of the control.

A rule will have to be used for this.

Please see the attached form for an example of this scenario working.

 

I used:

equals(Choice1,"B")

Disable.

0 Kudos
Reply
chris_cannon
Nintex Newbie

Re: Using Expression to Enable Form Field

Hi Simon,

 

Thank you for your response.

 

So the reason I have been using the expression section instead of a rule, is because I have duplicates of the same field. So in the actual form I have there are two "Optional_Fields": one as a Single Line Textbox and one as a List Lookup dropdown field. So basically when option A is selected, they are allowed to enter any value the user wants, while when option B is selected, the user must select a value already entered into the database. So when option A of "Choice_Field" is selected, I want to accept the value inputted from the first Optional_Field, and hide/disable the second Optional_Field. When option B is selected, I want to use the value of the second Optional_Field, and hide/disable the first.

 

The issue when using the rule is that when Option B is selected, the first Optional_Field is properly disabled, and I am able to select a value from the second Optional_Field; however, the value selected in that field is not successfully entered into the list, as if the first disabled field is still overriding it with a blank. Do you know why this is?

 

When manually disabling the first Optional_Field, I have been able to enter information into the database properly from the second Optional_Field, but could not create an expression that adjusts based on Choice_Field.

 

Let me know if you have any other suggestions or if this response is unclear. Thanks again! 

0 Kudos
Reply