WordPress Lookup Fields
After several months of working on version 2.01.0, a juicy new field type has been added to the menu: WordPress Lookup Fields.
The idea for this new field type came as a result of working directly with many of you in support. I saw a need for dynamic field options and values that our "Dynamic" field type didn't completely fill. There were several times I simply had to say "Sorry, this can't be done". There were other times where I would tell people they could achieve the dynamic relationship they needed, but it would require hours of tedious setup.
Eventually an idea formed that I realized would make complex relationships possible without hours of setup and without a giant headache. This is where Lookup Fields were born. I created Lookup Fields with you in mind. I looked at countless support topics to get an idea of the situations that needed to be addressed. My hope is that Lookup Fields will allow you to build the forms that you need with ease.
So, what do Wordpress Lookup Fields do? Well, they do a lot. Essentially they are useful in the following five scenarios.
Dynamic radio or dropdown options
Lookup fields get their options from submitted entries so you can easily create dynamic field options.
Wait, Dynamic fields already do this...right? The short answer is yes, Dynamic fields do this. The long answer is that Dynamic fields store an entry ID which is very useful in some situations, but it's also confusing and unnecessary if that's not what you want.
Lookup fields are plain and simple. They store the value exactly as you see it in the option. Also, Lookup fields automatically remove duplicates and they have an "Order" setting, intended to make your job easier. Checkboxes and multi-select dropdowns will be added to the Lookup field options shortly.
Cascading fields
Yes, this is something Dynamic fields can do too, but it's also what originally sparked the idea for Lookup fields. In order to set up a three level dependency (like Country/State/City or Year/Make/Model relationship) with Dynamic fields, three forms are required and three CSV imports (or thousands of manual entries). With Lookup fields, you can set up this type of dependent relationship with one form and one CSV import. This can save you a lot of time messing with data. Read more about setting up a cascading relationship.
Read more: How to Create Conditional Drop Down Lists in WordPress Forms
Drill down to a final cost
A lot of the times, using separate values is perfect for calculating a total cost. However, there are times when the value for an option changes depending on other options. For example, if you're selling insurance policies and the final price is determined by the selected company and state combination, you can use Lookup fields for this. After the company and state is selected, a text or number field will display the price. Read more about this here.
Select a value and populate fields
Make it easier for users to fill out forms if they've already submitted similar data. They can select a previously submitted entry from a dropdown field and voilĂ - the fields in the form are automagically populated with values from the selected entry. Read more about setting this up here.
This automatic population is currently limited to dropdown fields and text fields (and variations of text fields). This option will be added to more field types very soon.
Retrieve a value by searching
This is similar to #4, but the difference is that the value must be searched instead of selected. This is useful if you don't want the options to be visible to everyone. For example, maybe you want users to enter their email address and then a code appears in another field. Read more about setting this up here.
What's next?
So, what's next for Lookup fields? There are three main features that are "in the works" for Lookup fields at this time.
- Checkboxes and multi-select dropdowns
We will be adding a checkbox and multi-select dropdown setting to Lookup fields in coming releases. - Images
A Lookup > Image option will be added so it's easy to display image files from submitted entries. - Populating all field types
Currently, it's possible to use Lookup fields to automatically populate dropdown fields and fields with a text input. We will be adding the option to populate all field types.
These are the top three features that I'll be adding to Lookup fields in the coming months. Keep an eye out for them, and of course, let me know if you have any questions or suggestions.
If you would like to see what other changes 2.01.0 includes, take a look at our changelog.
Cole says
I've been hoping for a feature like this for forever. Can't wait to start using it! Thanks Formidable!
puntorosso says
Wow! This it's a really powerful addition to Formidable.
Great job, Jamie!
josephdowdy says
Does this mean that you can have a search field of "pre-populated" choices that are automatically populated from posts and pages? In other words, can Formidable Forms create a REAL choice for a WordPress search bar? That would be AMAZING if we could populate the search choices based on slugs from posts/pages!
Jamie says
This isn't what Lookup fields were designed to do, but we do plan to add this option to Dynamic fields in the future.
Steve Dillon says
I can't wait to replace my dynamic fields with the cascading lookup fields. This is great news!
Torrey says
This fixes a big hole in my app. Thank you for all your hard work to make such a powerful app.
Max says
Thumbs up!
David says
Can we filter users this way? ideally want facetwp features that works with users.
Jamie says
It's possible that you could do what you need with Lookup fields. Would you like to create a topic in the help desk with more information? Then I can tell you better if Lookup fields can do what you need.
Alex says
"Lookup fields get their options from submitted entries so you can easily create dynamic field options."
Will entries from others wp plugins software will be taken into account to ?
Jamie says
Unfortunately not - Lookup fields will only retrieve entries submitted in a Formidable form. Thanks for the inquiry though!
mariusfv says
Nice this feature with Lookup fields, my first thought was to a search form with autocomplete enabled.
But when jQuery instead of "Choosen" for dropdown autocomplete? We want to have mobile support for autocomplete dropdown fields too...
Jamie says
I'm not sure when Chosen will be switched out for jQuery's autocomplete, but Chosen did some updates and they are compatible with mobile devices now. If you have any questions about this, feel free to create a topic in the help desk! I would be happy to help if you have any issues with your autocomplete dropdowns on mobile devices.
Danny says
In your example the lookup field is a dropdown but is there a way that it can be a searchable input field?
I have a CSV of 300 businesses and their company information. I'd like to import it and build a form that can populate fields based on the lookup field.
Is this possible?