Setting Value of Field based on Another


Badge +8

Hi Community,

 

I'm use to building InfoPath forms where you had action rules and I have came across this problem of setting values of other fields based on another.  Currently I have drop downs for users that if they choose to select from it it will automatically set the value of other fields on the form. We are moving all our forms over to Nintex and I cant figure out how to do this with out having to write custom JavaScript on the form to do so.  Are there other options in being able to do this?

 

Thanks,

Kevin


17 replies

Badge +7

Hi,

If I correctly understand your need, you could do it with a second list, a lookup field in your form and the "lookup()" runtime function.

Below, a sample of a second list named "Choices" :

sample 1.png

In your form, use a "List lookup" control and map it on this list. Name your control "Choice".

Then, use some "Calculated Value" controls and set their formula as below :

sample 2.png

Finally, you should result on values, depending on a selection of the user.

sample 3.png

Regards

Badge +8

Let me Clarify a bit more.

User can select a item form a drop down list or they can just manual select the choices (option 1 or option 2).  If they use the drop down list it is to automatically set the choice to option 1.  These options are then tied to specific formulas to calculated other things, which i already have working its just getting it where if user picks something form the drop down it automatically sets the choice to option 1.

Badge +7

In my humble opinion, you can't do it without JavaScript in Nintex Forms.

You're able to set value of a field only as its default value.

Modifying its value depending on another field value seems to me unavailable.

To me, the only values you could change by using the form are calculated values.

Badge +4

using your suggestion, how can you make that calculated value field editable so one can modify the data in it to what they want?

I'm using a list lookup dropdown, i used your suggested lookup() function settings and it properly displays the list item's field information, but even when i have that calculated value field set to "Control Mode = edit" in the settings, i still cannot select it or modify the data in it.

Badge +7

I have probably not been clear.

When I said "the only values you could change by using the form are calculated values", I was thinking that those are the only control values that a dropdown control selection could change. But I never thought that you could select or edit it manually.

Badge +3

Hi

I have problem as the same as him, I want set field like InfoPath, in InfoPath when a field change it can change other field with Other field value or specific value or when condition is true other field change.

Thank you

Naeemeh

Badge +8

I also have a similar issue.  I have Field1 and FIeld2 I want to copy what is in Field1 to Field2.

Thanks,

Jennifer

Badge +16

do you have a space after ID in those speech marks?

also the format is:

lookup(list title, column to filter on, value to filter on, output column)

so based on what you have said earlier do you need to change "ID" to "Country"?

Badge +16

that is totally bizarre if they are configured in the exact same way!  just make sure you are picking the named control for country rather than item property as they will be different.

Badge +3

I have a similar issue. I've been asked to use the current user in a field if a box is checked.

If Image.PNG

It is easy to do this in InfoPath, but I haven't figured it out using Nintex Form.

I can set this in the Workflow, after it's submitted, but not while creating the new request.

Any help would be appreciated!

Thanks,

Vickie

Userlevel 5
Badge +14

I tried moving the columns around and it comes back with #value on the form and does not work.

is your 'Contry' control in a repeating section and calculate one out of it?

Userlevel 5
Badge +14

with nintex you can only do that by javascript

Badge +16

‌ did you ever resolve this?

Userlevel 5
Badge +12

I'd say vote up the option to make calculated fields editable:  Edit Calculated Value on Active Form – Customer Feedback for Nintex 

I know I've wanted that functionality in the past and it seems that some of the responders here desire it as well. 

Badge +16

this is now available in the rules builder on responsive forms happy.png

Badge +3

I faced the same issue. I tested the lookup function with a hard coded value (not from the named control) -- worked!

Then i just printed out the value of the named control and saw "1;#VALUE". So i had to modify the value first.

Badge +3

I know this is years old, but I've run into this issue in the past as well and realized a solution that may help others. The lookup function is as shown below:

 

lookup(list title, column to filter on, value to filter on, output column)
 
My value to fiter on was a lookup selector (not a direct item property) and when I added it directly into the formula as shown, it did not return anything. I finally figured out that this was because it was a lookup selector and it had to be parsed.
 
parseLookup([array or single lookup value], [optional bool showText])
 
So using the example in the OP, this is what finally worked for me:
 
lookup("Countries", "ID", parseLookup(Country), "TerritoryCode")

Reply