Skip to main content
Nintex Community Menu Bar
Question

How to set a field value based on another field value selected?

  • January 11, 2025
  • 4 replies
  • 89 views

Forum|alt.badge.img+1

I’m trying to set a field value based on another field value in a Nintex Form and I know I can do it using the form rules options, this way I can compare two values and based on it, set some variable to a specific value.

The problem is that the field values are not static, it’s comming from a google spreadsheet and the values may change with time. So, the issue is that, I can’t compare a value that will come from the spreadsheet because it doesn’t exist on the form yet and I don’t know what it can be.

 

“Classificação” is the field where the value is chosen, and “Conta” is a read-only field where the value will be displayed based on the “Classificação” choise.

 

Does anyone know how to do it? Even if it’s in a different way but with the same result. 

Translate
Did this topic help you find an answer to your question?

4 replies

Forum|alt.badge.img+8
  • Nintex Employee
  • 82 replies
  • January 12, 2025

@luizoliveira you could try using the if-else function on a form variable (I believe it works dynamically, so when your text control is populated, it will evaluate the condition):
 

The variable itself is the outcome, so you can display it in a label with whatever text you want to show depending on whether the condition evaluates to true or false. In the example above, if the value from my text box equals the value in a drop down list, then the label will show “Result: Yes”, else it shows “Result: No”
 

Translate

Forum|alt.badge.img+1
  • Author
  • Rookie
  • 1 reply
  • January 12, 2025

@Prineel_V3 I see, I believe we’re going to figure it out :) 

 

I wasn’t too clear on my explanation, and I need to metion that, the field values comes from a spreadsheet as a collection. So, imagine it’s a Goolge spreadsheet with 2 columns and 3 lines:

 

Value 1.1  |   Value 1.2

Value 2.1  |   Value 2.2

Value 3.1  |   Value 3.2        

 

So, I need to get these values from the spreadsheet, extract it as a collection and set values to the controller field, as I’m already doing here:

 

The same must occur  to “Conta” read-only field, but this one needs to be based on the “Classificação” field, it means that if I choose “Value 1.1”, then “Conta” field must be “Value 1.2”. What I think is, if I could handle it as an object like in a programming language it would be easier, but as I need to treat it as list (collection) I’m not sure how I do it.

Translate

Forum|alt.badge.img+8
  • Nintex Employee
  • 82 replies
  • January 12, 2025

@luizoliveira I think you can use the external data variables. This will allow you to query your google spreadsheet directly from the form and output the data in an object variable (you can also add conditions to the data lookup, so your condition would something like: Where column name = Classificação). You can then set the column that you need from the object into a form variable and insert it as a default value in the read only text control. You will need to create a data source/data lookup from your google connector:

https://help.nintex.com/en-us/nwc/content/designer/FormsExternalData.htm

Data Lookup:
https://help.nintex.com/en-us/nwc/content/Dashboard/DataSources.htm

 

Translate

SimonMuntz
Nintex Employee
Forum|alt.badge.img+22
  • Nintex Employee
  • 2437 replies
  • January 12, 2025

Hi ​@luizoliveira,

In most circumstances ​@Prineel_V3’s solution would work.
Unfortunately, it will not work for this situation. It will not work because the Google Sheets API does not return an object as Prineel assumes.  It returns an array with nested arrays for each row.

e.g [[Make:Model],[Toyota:Crown],[Ford:Mustang]]

As this is the case, data sources can only return the first row.

The only workaround I can think of is to create a workflow that creates a Nintex Automation Cloud table with the sheet data and then uses the table as a data source.

Have the workflow run on a schedule as needed to update or recreate the table.

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings