Conditional Dropdowns: Basic Setup

Before you get to setting the Conditional Behavior property, there's work to do. The most basic and recommended method involves completing these steps:

  1. Create three tables in your application.

  2. Create three one-to-many relationships among your tables.

  3. Enter some data.

  4. Modify field properties to set up your conditional field. The field properties let you define the conditions that determine what appears in the resulting dropdown.

Each of these steps is more fully explained in the tutorial below. You can follow the steps in this tutorial to set up the application used in the example above.

Note: While this is the most common and the recommended way to create conditional dropdowns, you can choose another method. Click to learn how.

Tutorial: Creating an Employee HR application with conditional dropdowns

Follow this tutorial to set up an application with that allows you to enter employee names, countries, and cities. The Add Employee form should contain a conditional dropdown, allowing you to filter the cities list based on the selection of the employee's country.

Step 1: Create an application with three tables

While your actual application may include many more than three tables, to achieve the conditional dropdown shown in the example form, you need to create at least the tables and fields shown in the table below:

table

Fields (all of type text)

Description

Employees

  • Last name

  • First name

You'll record all information about each employee in this table.

Countries

Country

Use this table to store the names of all countries where your company has at least one office.

Cities

City

Use this table to store the names of all cities where your company has at least one office.

Step 2. Create three one-to-many relationships

Each of your tables needs to know something about at least one other table in your application:

So, you should set up these three relationships:

The relationships should be set up this way because:

How reference fields help you with conditional dropdowns:

Once you've created these relationships, you should see these reference fields:

when you create this relationship...

...Quick Base creates this reference field in the details table

How the field helpS you create conditional dropdowns

Countries Cities

Related Country

Having the Related Country field in the Cities table lets you pair each city with a country.

Countries Employees

Related Country

Having the Related Country field in the Employees table lets you associate each employee record with the right country.

Cities Employees

Related City

The Related City field in the Employees table is your conditional field. Having this field in the Employees table lets you associate each employee with the right city. It also lets you set up conditional behavior that allows you to specify that Quick Base should check the selection of the employee's country and then filter the Related City list accordingly.

For now, just make note of the reference  fields that Quick Base created. You'll use these later in the process.

Step 3: Enter data in your application

Populate your Countries and Cities tables as follows:

countries cities

Canada

  • Toronto

  • Vancouver

England

  • London

  • Westminster

France Paris

United States

  • Boston

  • Chicago

  • New York

  • San Francisco

Step 4: Set Conditional Behavior properties for your conditional field

Remember that your goal is to create a form where you can enter employee information and be able to filter the City list based on the employee's country. You can see that your Employee table now contains these reference fields: Related Country and Related City fields.  The field you want to define as conditional is the Related City reference field in the Employee table.

To set Conditional Behavior properties for your conditional field:
  1. Access the field properties of the Related City field in the Employees table.

  2. Check The values in this field depend on a selection in another field. (Note: You'll see this option only in the field properties for Reference fields; if you don't see it, you may have chosen the wrong field by mistake.)

    Quick Base asks you select fields to complete this statement: A selection in <field1> shows choices where <field1> = <field2>.

  3. Set these conditions:

    1. In the first field, select Employees: Country. This tells Quick Base to check the value of the Employees: Country field to determine which cities to display.

    2. In the second field, select Cities: Country. This tells Quick Base to display only those cities that belong to the country the user selected.

    3. Click Save.

Cleaning up your Employee form

Depending on the order in which you created your relationships, your Employee form may contain an extra field (City--Related Country). If this is the case, simply edit your form properties and remove the field from your form.

Testing  your conditional dropdown

Once you've completed these steps, you can test your conditional dropdown by adding a new employee, Colleen Garton, to your Toronto office.

To test the conditional dropdown:
  1. From the Employees table, click + New Employee in the page bar.

  2. Enter Garton and Colleen, for Last name and First name, respectively.

  3. In the Country dropdown, select Canada.

  4. Click the Cities dropdown. Quick Base displays only the Canadian cities: Toronto and Vancouver.

  5. Select Toronto and click Save.

Related Topics:

 

Go back      |       |   

© 1999-2018  QuickBase, Inc.  All rights reserved.  Legal Notices.