Dependant select dropdown in form

Hi,

I’m struggling to setup a dependant select dropdown in my form.
I have two fields, Company and Contact.

I am not sure where I am going wrong. In the form, the companies are listed, but the Contacts don’t list.
There can be more than one contact per company.

I have setup something similar. I haven’t tried it with a Repeat before. I’m running two separate queries to get a complete list of companies and then based on the selected company_id, I get a list of the contacts. You can try this:

  1. Add a Get variable in the API selected_company_id
  2. Keep the 1st query qr_crm_depend_company
  3. Instead of Repeat Step, add a new multiple records query for the qr_crm_depend_contact - Under conditions - add a condition for company_id equal {{$_GET.selected_company_id}}
  4. In the App structure, add a new variable filter_company_id
  5. In the Server Connect sc_crm_company_contact, under Input parameter, click on dynamic picker for the Get variable selected_company_id and pick value for the variable filter_company_id
  6. Add dmx-on:updated="filter_company_id.setValue(value)" in the Select code for inp_interact_company_id. You can add this via Dynamic Events as well.
  7. Create a new Server Connect for the contacts query qr_crm_depend_contact and add it as a DataSource for the select inp_interact_contact_id
  8. The 1st select input will show a list of companies. When a company is selected, it will select all corresponding contacts from the contacts query based on the selected company id.
1 Like

@guptast! Awesome. I just started doing it the way your mentioned prior to your reply. but I made a small mistake which you cleared up for me in your reply! I also had the no auto load ticked for some reason, and I Deselected it and it worked.
Thanks so much!!! Your step by step instruction really helped! Worked beautifully. Quit nice to play with :slight_smile:

1 Like

Glad to know that it’s working the way you wanted :slight_smile:

1 Like

Sorry, a bit late on the scene. For others that come across this topic, have a look at

1 Like

Thanks @ben I also had a look at your lovely video! Helped a lot! Thank you.

1 Like