Filter a List of Options in a Lookup Question
For Dropdown, Multiselect, or Radio Button questions that “look up” data from a Data Source 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.
Set up a Data Source partition. Partitions Partitions are an Enterprise tier-only filter tool for large data sources. With partitions, users working on a form will only receive data that's relevant to them. There are two kinds of partitions: Dynamic and Regex. apply to the Data Source and all questions that use it.
Use the Multi-Column View and Default Sort Options. These make it easier for field users to select the right answer to a Dropdown, Multiselect, or Radio Button question.
Available on all tiers:
Contents
How a question-based filter works
Data Source setup
Question-based filters limit the options displayed for a lookup question.
We store Data Sources 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.
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”.
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.
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.
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 Section 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.:
-
Set up a lookup question so that the user can select a project number from the list.
-
Set up another lookup question that’s filtered by the selected project number.
-
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:
-
A TrueContext Admin user.
-
A member of a FormSpace FormSpaces are where forms are stored and organized in the TrueContext Web Portal. A TrueContext Team may have multiple FormSpaces, depending on their needs. Admins can set FormSpace permissions to control which users have access to the forms in that FormSpace. group with Can Create permissions.
Steps to set up a Data Source filter
-
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.
-
Select the Options tab, select Use Data Source for Options, and then choose a Data Source from the list.
-
Select the Column value displayed on device and the Column value submitted to server. These don’t have to be the same.
-
Toggle the Filter Options on.
-
Select the Filter Column.This is the column to check for a matching value.
-
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.
-
-
You can add more filter columns and comparison values. The lookup question only shows options that meet all of the defined criteria.
-
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:
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.