Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

Populate the Query parameter area

  • magtaf
  • magtaf
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
8 years 5 months ago - 8 years 5 months ago #281360 by magtaf
Populate the Query parameter area was created by magtaf
Hi Everyone,

I am using CB 2.0.14 and following
these instructions on inserting the SQL for states and I am stuck in the creation of the field.

I need help locating where this option is located in the new field screen.

step 4. Populate the Query parameter area of the field with:


I have already inserted the SQL in my database but cant seem to find the Query parameter field.
Last edit: 8 years 5 months ago by magtaf.

Please Log in or Create an account to join the conversation.

  • magtaf
  • magtaf
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
8 years 5 months ago #281361 by magtaf
Replied by magtaf on topic Populate the Query parameter area
Never mind, I found the answer. It requires the query plugin to be installed. It would be nice to insert this info in the instructions.

Please Log in or Create an account to join the conversation.

  • magtaf
  • magtaf
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
8 years 5 months ago #281362 by magtaf
Replied by magtaf on topic Populate the Query parameter area
I was able t get the state working but the ZIP and City are not working at all. I configured the field as per the following parameters in the instructions. Can anyone advise what is missing?

City Configuration
Select the 'Query Drop Down (Single Select)' type for your new field

Query:
SELECT DISTINCT `city` FROM `usa_zips` WHERE `state` = '[cb_usastate]' ORDER BY `city`

Set the 'Value Column' parameter to city
Set the 'Label Coumn' parameter to city
Keep the 'Group Column' parameter empty

State Configuration

Create a new CB Field from CB Field Management area
Query
SELECT `zip` FROM `usa_zips` WHERE `city`='[cb_usacity]' AND `state`='[cb_usastate]' ORDER BY `zip`

Configure the Update On parameter in the Query Tab to your previously created cb_usastate and cb_usazip fields
Set the 'Value Column' parameter to zip
Set the 'Label Coumn' parameter to zip
Keep the 'Group Column' parameter empty

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
8 years 5 months ago #281394 by krileon
Replied by krileon on topic Populate the Query parameter area

Never mind, I found the answer. It requires the query plugin to be installed. It would be nice to insert this info in the instructions.

It says "The CB Query field plugin (version 5.0.2 or better) supports 5 additional field types that get their select values from a database query." directly as the fist sentence.

I was able t get the state working but the ZIP and City are not working at all. I configured the field as per the following parameters in the instructions. Can anyone advise what is missing?

What's not working? They're not displaying any values? Your queries are dependent on previous fields. This means you need to configure "Update On" so they update their values when the previous field changes value.


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: magtaf

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum