We use list fields all the time, but what would you do if you had 100 items to add? I wouldn’t want to add them one by one, and I’m sure you prefer not to either. In this post, we’ll tell you how to populate list fields using Ninja Forms, the easy way.
(This technique works with every type of list field: checkbox list, radio list, multi-select, and select.)
How to populate long list fields in Ninja Forms
We’ll use a feature that you can find in every list field, it’s called Import.
Instead of adding your options to the list field one by one, you can input them by following the format mentioned in the picture. It’s called CSV, or ‘Comma-Separated Value’. Just believe me, it’s not as complex as it sounds.
Prepare a CSV for your items
Now, how do we create a CSV? You can actually do it on any software that allows you to type words in. But if you’re here, then most likely you already have a list that you want to import to Ninja Forms. Here’s a quick tutorial from Salesforce on converting XLS to CSV.
It’s actually really simple.
Because Ninja Forms provides three values for every option in a list field (label, value, calc value), you can input up to three values for every line.
Sometimes you don’t need all three, so here’s what will happen for each case. If you have:
- one value for each line, then it will become both your label and your value fields
- two values for each line (for label and value), then they will become your label and value fields
- three values for each line, they will become your label, value, and calc value fields
For now, I’ll go with two values for each line.
Developers, dev
Designers, designers
Business Owners, business
Others, others
Do you have your CSV ready?
Copy and paste the CSV into the Import field
Now, the easy part. Go to your list field, and click the ‘Import‘ button next to the ‘Add New’ for the options list.
Simply copy your CSV, and then paste it without any formatting into the box. Click ‘Import’.
And that’s it! Here’s what my list looked like after I imported the CSV.
It’s easy to populate a long list field!
Populating a list field with hundreds of items will only take you a few minutes with Ninja Forms. We can imagine it being useful for lists of postcodes, countries, or cities. Let us know in the comment what you’re using this feature for, or if you have any questions about this feature! We always want to hear from you.