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,
Cyrus Mohseni.
How do your Excel skills stack up?
Test NowNext up:
- The Aussie Meat Pie of Managing Teams
- Introduction to Office 365 Video
- Entity Framework Code-First
- The awesomeness that is AngularJS – Part 1
- What Customers Want
- Deleting an undelete-able site collection
- Non-Breaking Spaces & Non-Breaking Hyphens in Word
- Creating a simple Website and User Interface with MVC – Part 1
- Welcome to the new Edge
- Courage? …I’m feeling quietly confident
Previously
- Create a Chart Template in Excel
- Setting up your models in MVC
- No need for meeting notes anymore!
- “If you can’t measure it…”
- The best features in Office 2016!
- Use a slicer to make better business decisions
- What’s a JavaScript Closure?
- Put that marker down and Redact in Acrobat please!
- Understanding your customers with 6 questions
- New security features in Windows 10