🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials November 2, 2026

How to Create Chained Selects in Gravity Forms from a CSV File

GravityExtra
How to Create Chained Selects in Gravity Forms from a CSV File

Long drop-downs are one of the quickest ways to lose a visitor halfway through a form. A list of every city your company delivers to, every product model you have ever sold or every branch in every region is hard to scroll, easy to get wrong and slow to load. The usual answer is a set of chained selects: the visitor picks a country first, then only the states of that country appear, then only the cities of that state. This guide shows how to build chained (cascading) drop-downs in Gravity Forms from a simple CSV file, how to keep the list up to date by uploading a new file, and how to make sure nobody can submit a combination that does not exist.

What chained selects are, and when you need them

A chained select is a drop-down whose choices depend on the answer to the field above it. The classic example is an address: Country, then State or Region, then City. But the same pattern fits many forms:

  • Product finders: Brand, then Model, then Size or Year.
  • Service requests: Department, then Service, then Location.
  • Schools and training: Campus, then Course, then Session.
  • Dealers and branches: Region, then Town, then Branch.
  • Warranty and repairs: Product line, then Model, then Part.

In every case the visitor sees a short, relevant list at each step instead of one list with thousands of entries. Fewer choices on screen means fewer mistakes, and the data you collect is cleaner because every answer comes from your own list.

Why a CSV file is the easiest data source

Most teams already keep this kind of list in a spreadsheet. Typing hundreds of choices into the Gravity Forms editor by hand is slow, and keeping several fields in step when something changes is worse. With the Gravity Forms Dynamic Populate Pro add-on (version 2.1 and later) you export the spreadsheet as a CSV file, upload it to the WordPress Media Library and point your fields at it. The first row of the file holds the column names, for example:

country,region,town,postcode
Viet Nam,Region 01,Town 01-01,10000
Viet Nam,Region 01,Town 01-02,10010
Japan,Region 07,Town 07-03,70030

Each row is one complete, valid combination. That one file can feed all three drop-downs: the Country field shows each country once, the Region field shows the regions of the chosen country, and the Town field shows the towns of the chosen region. Comma, semicolon, tab and pipe separated files all work, and the file can hold tens of thousands of rows: we test every release with a 20,000-row file.

Step 1: Upload the CSV and fill the first drop-down

  1. Upload the file under Media → Add New. You can also click Upload a CSV to the Media Library in the field settings; it opens the uploader in a new tab.
  2. Open your form and add a Drop Down field called Country.
  3. On the field’s General tab, tick Populate this field dynamically, set Source to CSV file and pick your file. Click Reload list if you uploaded it after opening the editor. The column names of the file appear under the list, so you can check you picked the right one.
  4. Set both the Label column and the Value column to country. The label is what the visitor sees; the value is what is saved in the entry.
  5. Keep Remove duplicate values ticked, so each country appears once even though it is on hundreds of rows, and choose Sort by country for an A–Z list.

Gravity Forms field settings using a CSV file as the data source, with label and value columns and a chained select that depends on the Country field

Step 2: Chain the second and third drop-downs

  1. Add a second Drop Down called Region. Populate it from the same CSV file with the label and value column region.
  2. In the Chained select block of its settings, set Depends on field to Country and Column that holds its value to country. Region now only shows rows whose country matches the visitor’s choice.
  3. Add a third Drop Down called Town, from the same file with the column town, depending on Region with the column region.
  4. Save the form.

There is a detail here that matters for real data: region names often repeat. Many countries have a “North” region, and our test file has a “Region 01” in every country. Because Region and Town read the same file, the Town field automatically matches the chosen country as well as the chosen region, so towns from two different countries never mix. You do not have to add that rule yourself.

Until the field above has a value, a chained drop-down shows “Select an option above first”. As soon as the visitor picks a country, the regions load in the background without reloading the page, and changing the country later refreshes the regions and towns straight away.

A Gravity Forms form with chained Country, Region and Town drop-downs filled from one CSV file, plus a population value looked up from the same row

Step 3: Look up more values from the same row

Once the visitor has chosen a town, you often want more data from that row: a postcode, a delivery fee, a contact e-mail for the branch, a product price. Add a Single Line Text, Number or Hidden field, set it to populate a Value from the same CSV file, and add a filter such as town is {Town:3}. The field fills itself as soon as the town is chosen, and the value is saved with the entry so you can use it in notifications, conditional logic and calculations.

The same filters work on any column. You can show only active rows (status is active), rows above a stock level, or rows that match a value the visitor typed into another field. Filters can be grouped with AND and OR.

Keep the list up to date without editing the form

When your list changes, edit the spreadsheet, export it again and upload it over the old file (for example with a media replace tool that keeps the same file). The add-on notices that the file has changed and shows the new choices at once; there is no cache to clear. Entries that were already submitted keep the values they were saved with, so old records stay correct even when a town is renamed or removed.

Large files are read once and kept in a fast cache until the file changes. In our tests a 20,000-row file loads in a fraction of a second, and each step of the chain is answered in milliseconds on the server.

Stop impossible combinations on submit

Chained drop-downs make mistakes unlikely, but a browser can still send anything: an old page left open in another tab, a browser extension, or someone deliberately editing the page. Every field that is part of a chain is therefore checked again on the server when the form is submitted. Its value must be one of the choices that belong to the values above it. If a visitor sends a town that is not in the chosen region, the form shows “Please choose an option from the list.” on that field and the entry is not saved. Fields that are not part of a chain are not affected by this check.

Your data stays yours

  • Only the columns you use reach the browser. If the CSV also holds internal codes, costs or notes, they stay on the server. Only the label, value and price columns you choose are sent to the visitor.
  • Files come from your own site. Fields read files from your Media Library. Administrators can also use a file URL, but only from this site’s own uploads folder; files on other sites and files that visitors uploaded through forms cannot be used.
  • Clean text only. HTML tags in the file are removed before they are shown, while text such as “< 5 years” is kept.
  • Editors need the right permissions. Choosing a CSV file needs the permission to use the Media Library, and a file URL needs an administrator.

Not using a spreadsheet? Chain any source

CSV is the quickest start, but chained selects work with every source in Dynamic Populate Pro:

  • Taxonomy terms: a category tree such as Region > Country > City. The first level shows terms whose parent is 0; each next level depends on the field above with the property parent.
  • Gravity Forms entries: for example Make > Model from entries of another form, so the list grows as your team adds records.
  • Posts and custom post types: chain by a custom field or a taxonomy that holds the parent’s value, for example courses by campus.

Every chain gets the same live refresh and the same check on submit.

Tips for a smooth chain

  • Give every column a unique name in the first row. Empty names become “Column 3” and so on, which is harder to recognise later.
  • Use the same spelling everywhere. “Viet Nam” and “Vietnam” are two different countries to a computer. Clean the spreadsheet once and every field benefits.
  • Raise the limit for long lists. A drop-down shows up to 200 choices by default; set Limit higher if one level has more.
  • Turn on searchable drop-downs under Forms → Settings → Dynamic Populate so lists longer than 15 choices can be filtered by typing.
  • Mark the last level as required if every entry needs a full combination.

Frequently asked questions

How many levels can a chain have? As many as you need. Point each level at the level above it. Three levels (country, region, town) is the most common.

Does it work on multi-page forms? Yes. The choices are rebuilt from the submitted values on every page, and each page is checked when the visitor moves on.

What happens to my existing forms when I update? Nothing changes. Version 2.1 adds the CSV source and chained selects as new options; fields that do not use them work exactly as before, and your settings and entries are kept.

Can I use checkboxes or radio buttons? Yes. Any choice field can be filled from a CSV file, and a checkbox or multi-select field can be the parent of a chain; the next level then shows the rows that match any of the ticked values.

Is anything sent to an outside service? No. The CSV file is read from your own server; the only outside requests are the GravityExtra license and update checks.

Read the full Dynamic Populate Pro documentation for every option, or get the Gravity Forms Dynamic Populate Pro add-on and turn your spreadsheet into chained drop-downs today.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr