Filter a List of Options in a Lookup Question

For Dropdown, Multiselect, or Radio Button questions that “look up” data from a Data SourceClosed Data sources, also known as "Lookups", are external sources of data that you upload or connect to TrueContext. You can reference this data in a form to populate answers or answer options. Data sources save typing, reduce errors, and make it easy to provide mobile users with only the relevant, most current data., you can filter the list of options. Filtering makes it easier and faster for field users to complete a form. This topic describes how filters work and how to set up filters for a lookup question.

Info:This topic describes question-based filters. Customers on the Enterprise tier can also:

Available on all tiers:

Essentials
Advanced
Enterprise

Contents

How a question-based filter works

Data Source setup

Question-based filters limit the options displayed for a lookup question.

We store Data SourcesClosed Data sources, also known as "Lookups", are external sources of data that you upload or connect to TrueContext. You can reference this data in a form to populate answers or answer options. Data sources save typing, reduce errors, and make it easy to provide mobile users with only the relevant, most current data. as tables (rows and columns) in the TrueContext system. You can filter the options in a lookup question by any column in your Data Source.

The following example shows a Data Source with multiple columns.

Excel worksheet that shows multiple columns, with "Project Number" as the column to display and "Username" as the column to filter on.

Tip:This example uses the “Project Number” column to display options, and the “Username” column to match. When you set up a filter, you can match any column in the Data Source, it doesn’t have to be the username.

Filtered options on the device

In this example, a Dropdown filter based on the signed-in username displays the Project Number specific to the Mobile App user “elektra”.

Filtered list of options that shows 1234567 available to select. This is the only option available for the signed-in user.

Filter options in the Form Builder

The following example shows the “Project Number” filtered by the Mobile App username.

Tip: TrueContext detects the signed-in username dynamically—you don’t have to set up a specific value.

Form Builder that shows a Dropdown "Options" tab with the "Column value displayed on device" set to "Project Number" and the Filter column set to "Username" (a column in the Data Source) "Equals" "Mobile user's username" (which dynamically gets the signed-in username)

Cascading Data Source filters

You can “stack” Data Source filters sequentially to create a cascade effect:

  • The answer to Question 1 limits the options in Question 2.

  • The answer to Question 2 limits the options in Question 3, and so on.

Note:Questions 1 and 2 in this example can be Dropdown or Radio Button, but not Multiselect.

The following illustration shows an example of a Data Source that has a column for “Project Number”. The filter is set to match the project number selected in the form. The form displays only those “City” options that match the selected project.

Table view of a Data Source that has a column for "Project Number". When a filter is set to match the project number selected in the form, the matching row values become options in the lookup question. The image shows four matching rows out of nine that match the project number 1234567.

Video demo of a cascading Data Source filter

The following video demonstrates how filtering works in the Mobile App and how to set up the questions in the Form Builder. In this example, cascading filters affect the “City” question and the “Client Names” pushed to the Repeatable SectionClosed A Repeatable Section is a subform that contains a set of related questions. The data captured is “repeating”, because the field user can complete the same subform more than once, which creates multiple entries.:

  1. Set up a lookup question so that the user can select a project number from the list.

  2. Set up another lookup question that’s filtered by the selected project number.

  3. Push data from the second lookup question to another question, in this case, a question in a Repeatable Section.

Set up a Data Source filter

Prerequisites

You must be either:

Steps to set up a Data Source filter

  1. Add or edit a Dropdown, Multiselect, or Radio Button lookup question.

    Info:To filter another lookup question based on the answer to this one, use either a Dropdown or Radio Button question. The section Cascading Data Source filters describes this option in more detail.

  2. Select the Options tab, select Use Data Source for Options, and then choose a Data Source from the list.

  3. Select the Column value displayed on device and the Column value submitted to server. These don’t have to be the same.

  4. Toggle the Filter Options on.

    "Options" tab that shows Filter Options toggle switched on, "Filter Column" with "Name" selected, operator "Equals", and the values to compare list that includes "Type to add a constant", "Mobile user's username", and a list of other questions in the form.

  5. Select the Filter Column.This is the column to check for a matching value.

  6. Select an operator, and then select or enter the comparison value. You can choose:

    • A constant—Enter the text that you want to match on.

    • The answer to a previous question in the form—For example, in a previous question, the field user selects a region. The options displayed in the filtered question only include the customers located in the selected region.

    • The signed-in mobile user’s username—For example, an inspection form requires the user to enter their User ID. By filtering the question to match on the username, the only option available to the user is the correct User ID.

  7. You can add more filter columns and comparison values. The lookup question only shows options that meet all of the defined criteria.

  8. Select Save to save your changes.

Note:To make sure your Data Source filters work as intended in the field, test them thoroughly before you deploy the form. Test the form under a variety of conditions to validate the field user experience.

Data Source Translations

Available as an add-on to the Advanced and Enterprise tiers:

Essentials
Advanced +Add-on
Enterprise +Add-on

With the Multi-Language feature, you can create a single form and provide it to your field users in multiple languages. A Data Source can provide a list of translated options for a Dropdown, Multiselect, or Radio Button lookup question.

Info:The section Data Source Translations: Set up a lookup question to use Data Source translations describes in detail how to set up a question to display options in the selected language.

Related topics