[SOLVED] Anybody done CB query to autofill field from field

12 years 5 months ago - 12 years 5 months ago #183739 by fribse2011
Has anybody set up the CB query plugin to fill one field, depending on another field?
In Denmark we have 'postnummer' / 'by' (zip code - city).
I have the table in the database, and I would like to let the user fill in just 'postnummer' and then the CB query should give the 'by' value.
I've tried figuring out how to do it with CB query, but I just can't get my head around it.
Anybody has some insights for me?

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

Please Log in to join the conversation.

12 years 5 months ago #183750 by krileon
If I understand correctly you want to pass the zipcode to the database table then grab the city and store city in a new field? For example cb_zipcode, then update cb_city after registration? It maybe better to use CB Query Field so it's dynamic and changes based off the zipcode field rather then having to constantly worry about the city being stored properly. Need clarification on your needs before I can suggest anything further.


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.

12 years 5 months ago #183781 by fribse2011
I was thinking of using the cb query field, can I use it 'anywhere' like in acymailing?
I would very much like to write members addresses in newsletters, so they can keep them updated.

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

Please Log in to join the conversation.

12 years 5 months ago #183785 by krileon

can I use it 'anywhere' like in acymailing?

If acymailing supports CB substitutions then yes.

Example query for CB Query Field as follows.
SELECT `city` FROM `#__cities` WHERE `zip` = '[cb_zipcode]'

This of course is just an example and would need to be customized based off how your database is structured.


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.
The following user(s) said Thank You: fribse2011

Please Log in to join the conversation.

12 years 5 months ago #183832 by fribse2011
Hi Krileon

That does the trick perfectly, only problem is that I can't make it show up on the "edit profile" page, what have I missed?
I need to show it, when people enter it, and as I don't show their address on the 'view profile' page, it doesn't show up anywhere :-)

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

Please Log in to join the conversation.

12 years 5 months ago #183847 by fribse2011
Acymailing supports all sorts of fields from CB, but neither of the two query fields I've created appears in the overview to be inserted.
I'll try and contact acymailing...

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.682 seconds

Facebook Twitter LinkedIn