Sep 29, 2015
Quite often in a form we need to populate a dropdown based on the value of another dropdown. For example we might need to select a value from a States dropdown after we have selected a Country from another dropdown control. So we require that the States dropdown to only list the states corresponding to the country that we have selected in the Country dropdown and not more.
To do this we first need to develop two reference tables (or Lists in SharePoint). The first list has one column to hold values for Country. The second reference list has two columns. The first column is a look-up to the first reference list’s Country column and the second column holds states for each country as shown in the pictures.
It is important to note that the Country_Lookup column in the CountryState list has to be a look-up column to Country_Ref column of the Country list.
We call the two lists, Reference Lists because they are static and their existence is only to be used for lookup operation.
Now we develop our Transaction list. We call it a Transaction List because this is a dynamic list that users use to input data into, using a Nintex form.
Here’s an example of such list called Sales.
Moving now to the design of our Nintex form;
To add dropdown controls for Country and State we should add two List Lookup controls from SharePoint category, shown in the picture.
Double click on the Country Lookup control and change the settings as shown in the picture.
Here you should give a name to the control because we are going to use this name in the other control. I’ve called it MyCountry.
In the Source List you select Country list to indicate that we want it to show values from the Country list and in the List column name you type Country_Ref because this is the column in Country list that holds the values.
Save the settings.
Double click on the State lookup List and change the setting as shown in the picture.
We want the control to store the values in the State column of the Sales list, so we should select Sate in the ID connected to.
As we need the control to show the states from the CountryState list, we select CountrySates list in the Source list and type State_Ref in the List column name. This box is case sensitive so make sure you type exactly as the column name. If you type State_ref it is not going to work.
In the Filtering section select By a control’s value in the Filter available selections because we want the control to show only values based on the value selected in the previous control that we named MyCountry.
In the Filtered by control we select MyCountry of course and in the Where field we indicate that the filtering should apply to the Country_Lookup column of the CountryState list.
That’s all we need. Don’t forget to save the settings.
We should now be able to select a country from the Country dropdown, the screen flickers a bit to refresh the values in the State dropdown, and in the State dropdown you should see only states for that country.
Hope this has helped,