The Single Line Text element has the ability to utilize auto-complete data sets. When a responder starts typing into a Single Line Text element with an auto-complete data set defined, items within the set will be presented, filtered by what has already been entered by the user. The user can then choose an item from the list to set as their response to the element.
Auto-complete data sets allow you to define a set of data once versus needing to define the set with each use, such as when using a Dropdown or Multiple Choice element. In addition, especially when the number of options is large, auto-complete data sets provide a performance benefit compared to a Dropdown element with the same set of choices.
When setting an auto-complete data set on a single line text element, you have the option to Restrict Response to List. This requires that the value in the single line text element is a value found in the data set. If the Restrict Response to List option is not selected, the auto-complete data set acts as a list of suggestions, but any value can be entered by the user.
Pre-Built Data Sets
The auto-complete option currently offers the following pre-coded data sets:
List of country names
The data set is comprised of all values that previous users have submitted in this field. Not recommended to use this set with the Restrict Response to List option.
List of students in class the form is shared with (teacher created form only).
List of students in the current school.
List of all student in the district.
List of all schools in the district.
Student Current Schedule
For a student form, a list of the student’s enrolled classes for the current year.
List of teachers in the current school.
List of all teachers in the district.
Custom Data Sets
You can also create your own auto-complete data sets.
One method is to create a Gen table Category. The easiest way to accomplish this is to create a tab delimited text file with one column for the category (‘bus_route’ in our example), another column for the label (visible text), and a third for the value that will be saved when the form is submitted. Because this is a Single Line Text box, the label and value must be the same. You also have the option to store a value in the database that is different that the displayed value. To use this option, add a fourth column for ValueT. The data might look something like this:
Cat Name Value ValueT
bus_route Park Ave Park Ave Route1
bus_route 5th Avenue 5th Avenue Route2
You can use the Quick Import tool under Special Functions > Importing & Exporting > Quick Import and select table ‘Gen Table (code values)’. Map the first column to Cat, the second to Name, the third to Value, and the optional fourth to ValueT. CAUTION: Make sure the Cat you choose is unique and hasn’t already been used in the Gen table.
You can now reference bus_route in the box labeled ‘Category’ in your Single Line Text element’s properties.
Another method is to use the Extended Schema, in which your list is made up of all the values found in a specific field in a one-to-many extension. The extension must be an off of the student table for student forms and the teacher table for teacher forms.
End User Experience
When the end user views a form with a Single Line Text element that has been linked to an auto-complete data set, there will be a button visible at the end of the element.
The user can click on the button, which will present a list of all the items in the data set.
The user can select an item directly from the list to populate the Single Line Text element, similar to how a Dropdown element works.
Alternatively, the user can type into the Single Line Text element and options from the data set that match what the user is typing will be presented. The user can choose one of the filtered options to populate the Single Line Text element.