Skip to main content

Using Lookup to cascade dropdown values

Filter each Lookup dropdown by the category selected above it, and clear dependent selections when a parent changes.

Use Lookup controls when your category choices come from Yeeflow data lists. Each selection filters the choices at the next level. For categories maintained centrally, see Using Metadata to get cascade values.

Use Case

In an expense request, the employee selects Travel, then Transport, then Rail. If they change Travel to Office, the form should clear the two dependent selections and offer the Office categories.

Step 1 - Create Data List with cascade

  1. In your expense application, create three data lists named Expense Categories, Expense Subcategories, and Expense Types. Use each list’s title field to display its category name.

  2. In Expense Subcategories, create a single-selection Lookup field named Parent Category that points to Expense Categories. In Expense Types, create Parent Subcategory pointed at Expense Subcategories.

  3. Index both parent fields on their respective source lists. Lookup filters can select only indexed source fields. See the Lookup filter requirements.

  4. Add Travel → Transport → Rail and Office → Supplies → Printer Paper as test branches. Select the matching parent in each child record.

Step 2 - Set Lookup in Form Designer

  1. Add three Lookup controls to the expense form, with distinct fields or variables for Expense Category, Expense Subcategory, and Expense Type.

  2. In Content → Basic, choose the source application and list for each control. In Appearance, use the title as the display field, choose Dropdown, and keep Multiple off.

  3. Leave Expense Category without a parent filter. In Expense Subcategory, open Data Filters and set Parent Category to equal the current form’s selected Expense Category. In the Expression Editor, reference the Lookup value that identifies the record. The title is what the dropdown displays.

  4. On Expense Type, set Parent Subcategory to equal the form’s selected Expense Subcategory.

Set up form actions on value change to clear the dependent selections. When the category changes, clear subcategory and type. When the subcategory changes, clear type. Use the field’s associated variable in the Set variables step and verify the result in preview.

Use Dynamic Display Rules to hide a child control while its parent has no value. Data Filters determine which records appear in each dropdown.

Step 3 - Manage the layout and Publish

  1. Place the dropdowns in category order and open form preview.

  2. Select Travel → Transport → Rail. Change Travel to Office and confirm both child values clear. Choose Supplies → Printer Paper and clear Supplies to check that the type clears on its own.

  3. Save and publish the form or workflow version as appropriate. Open the published form as a test user, save or submit a test request, and reopen it to confirm that the stored categories match.

Futhermore

For repeating detail rows, bind each child filter to the parent selection from its own row. Test two rows with different parents and confirm a change affects only its own row.

See Using Lookup to return multiple values for filling other form fields from the selected record, and Using Lookup List to return rows of values for copying records into a list on a form.

The diagram below shows the effects of the first two selections on the next dropdown.

Yeeflow lookup cascade. Travel filters the second dropdown to its subcategories. Selecting Transport filters the third dropdown to types such as Rail.
Did this answer your question?