Hello,
I hope this email finds you well. I am reaching out to seek your assistance with an issue we are experiencing.
Details of the issue:
We have configured two forms as follows:
1. Form1 contains a single field for selecting a "Country."
2. Form2 includes two fields: A "Country" dropdown field dynamically populated from Form1. A "City" field where users can manually add cities.
The issue:
After adding a few cities in Form2, we noticed that the "Country" dropdown menu in Form2 begins to display duplicate country entries.
What we need:
I’m looking for a way to ensure the "Country" dropdown menu in Form2 only displays unique countries, regardless of how many cities are added.
If there are specific steps, settings, or adjustments required to achieve this, please let me know. Your guidance will be greatly appreciated.
Thank you in advance for your support.
I refer you to: Dynamic vs. Lookup for an explanation and frm_data_sort for a possible solution.
Thanks Rob, this is what I was looking for.
One more thing, Rob. Can I use lookup to populate data from two different forms.
For example:
Get data from Form 1: Country
Get data from Form 2: City that matches with Country in form 1
I suggest reading this page about dynamic cascading - https://formidableforms.com/knowledgebase/dynamic/#sts=Set%20up%20cascading%20fields
Thank you for sharing the KB! It worked well when each dropdown pulled data from a different form. However, when I tried having two dropdowns in the same form, where the second is based on the first's selection, it didn’t work.
Please explain what part is not working.
Hi Rob, below is an outline of how my forms are structured:
Form 1:
•Field: Country (Text)
Form 2:
•Dynamic Dropdown: Loads data from Form 1 (Field: Country)
•Field: City (Text)
Form 3:
•Dynamic Dropdown 1: Loads data from Form 1 (Field: Country)
•Dynamic Dropdown 2: Loads data from Form 2 (Field: City)
•Field: Name (Text)
•Field: Mobile Number (Phone)
Form 4:
•Dynamic Dropdown 1: Loads data from Form 1 (Field: Country)
•Dynamic Dropdown 2: Loads data from Form 2 (Field: City)
•Dynamic Dropdown 3: Loads data from Form 3 (Field: Name)
•Dynamic Dropdown 4: Loads data from Form 3 (Field: Mobile Number)
The Issue:
•Up to Form 3, everything works as expected.
•In Form 4, I can successfully filter "Country," "City," and "Name."
•However, the Mobile Number dropdown (Dynamic4) doesn’t sync with the selected "Name" from Dynamic3. Instead, it shows all mobile numbers from Form 3, irrespective of the selected "Name."
I agree with Rob about using Dynamic Lookup fields. What I don't understand is you process. How are users adding multiple cities in Form 2? Are you having them hit submit after every entry? Are you using Ajax to submit the form? Each time you add a city record to Form 2, you are creating a field entry for the dynamic dropdown. This is why you see duplicated county names for each city a user adds. There is a solution, though.
The solution means filtering the dropdown values to ensure their uniqueness in the frm_setup_new_fields_vars and frm_setup_edit_fields_vars filter. You can see how the filtering works in the country search dropdown on this page: https://formidable-masterminds.com/developers-directory/
I thought I could share the code I use for that dropdown, but it's highly customized for my needs. I created my own SQL to filter the dropdowns. This is a good place for you to start, though: https://formidableforms.com/knowledgebase/frm_setup_new_fields_vars/#kb-filter-dynamic-field
Hi Victor
I'm open to suggestions. What I'm trying to achieve is:
1. Form1 contains a single field for typing a "Country."
2. Form2 includes two fields:
A "Country" dropdown field dynamically populated from Form1.
A "City" field where users can manually add cities.
3. Form3 includes three fields:
A "Country" dropdown field dynamically populated from Form2.
A "City" dropdown field dynamically populated from Form2.
A "State" field where users can manually type their state.
I'm trying to figure a way to make the Country field added once then linked to other forms, that way if I modified the Country name it will be applied to all forms that linked to Country field along with City name.
Follow the directions in the KnowledgeBase article Rob referred you to. It gives you step by step instructions.
Please login or Register to submit your answer