Developer Documentation Library > Interview templates > UXUI custom properties > uxui_list_autocomplete
 
uxui_list_autocomplete
The uxui_list_autocomplete property supports an auto‑complete question: the respondent types some letters, and then the question is displayed with a list of choices that correspond.
Format
uxui_list_autocomplete = "{ dataSource: '<public_function>', filterLength: <n>, matchMode: {0|1} }"
Parameters
dataSource
The name of a public function that returns the list of choices as an array or as categories.
filterLength
The minimum number of characters to be typed before the public function is called.
The default value is 3.
matchMode
The matchMode is passed to the public function. By convention, this is 0 for a starting match, and 1 for a match anywhere in the string.
Example
The following example calls a public function named GetOccupations after the respondent types 3 characters, and that the function should match those characters anywhere in the string.
uxui_list_autocomplete = "{ dataSource: 'GetOccupations', filterLength: 3, matchMode: 1 }"
The following example defines a GetOccupations function for an Occupations database question:
Function GetOccupations(IOM, Filter, MatchMode)
Dim Codes
Set Codes = IOM.Questions["Occupation"].Item["Codes"]

If (MatchMode = 0) Then
Codes.DBFilter = "LCase(Occupation) LIKE '" + LCase(Filter).Replace("'", "''") + "%'"
Else
Codes.DBFilter = "LCase(Occupation) LIKE '%" + LCase(Filter).Replace("'", "''") + "%'"
End If

Set GetOccupations = Codes.Categories
End Function
Applies to
Text questions only
Example
See Occupation (Autocomplete dropdown using PublicFunctions) in the “Features” example.
See
UXUI custom properties