[SOLVED] Bulk import of dropdown field item

6 days 7 hours ago - 3 days 17 hours ago #322522 by AlexRag
Is there a way to mass import a list to populate a Dropdown (Multi-Select), Dropdown (Single Select) or Radio Button field item?

Entries like Provinces, States or even Country are significant and to add one at a time.

Please Log in to join the conversation.

5 days 17 hours ago #322546 by krileon
Replied by krileon on topic Bulk import of dropdown field item
Use a custom database table combined with Query Select, Query Radio, etc.. fieldtypes. This allows you to build the options based off your custom database table.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

5 days 12 hours ago #322571 by AlexRag
Replied by AlexRag on topic Bulk import of dropdown field item
That's a clever idea. So I can create a table in the same database as the website with the data I need?

Please Log in to join the conversation.

4 days 20 hours ago - 4 days 20 hours ago #322583 by krileon
Replied by krileon on topic Bulk import of dropdown field item
Yup. If you're trying to make a Country or Province dropdown and are using CBSubs then CBSubs already provides such databases. Below is how to set this up so country chains into updating the available states/provinces.

www.joomlapolis.com/forum/255-developer-members-support/240757-query-drop-down-single-select-displaying-value-not-label-after-update?start=6#311513

If you've any questions about the above usage please just post them here as it is an old topic. The Update On usage noted in the above is provided by CB Core Fields Ajax.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

4 days 14 hours ago #322608 by AlexRag
Replied by AlexRag on topic Bulk import of dropdown field item
Excellent, I will give this a go. That would save tonnes of time.

I did notice this in play in the "Update Billing Address" area of the checkout process and wondered about how to add it to the registration form!

Please Log in to join the conversation.

3 days 17 hours ago #322663 by AlexRag
Replied by AlexRag on topic Bulk import of dropdown field item
The Query worked like a charm! I've added your suggestion here for my future reference.

Field: cb_billingcountry
Query
SELECT `country_name`, `country_region`
FROM `#__comprofiler_countries`
ORDER BY `country_region`, `country_name`
Value Column: country_name
Label Column: country_name
Group Column: country_region

Field: cb_billingstate
Query:
SELECT p.`province_iso_code`, p.`province_name`
FROM `#__comprofiler_provinces` AS p
LEFT JOIN `#__comprofiler_countries` AS c
ON c.`country_iso_code2` = p.`country_iso_code2`
WHERE c.`country_name` = '[cb_billingcountry]'
ORDER BY p.`province_latin_name` asc

Value Column: province_iso_code
Label Column: province_name
Update On: cb_billingcountry
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.415 seconds

Facebook Twitter LinkedIn