Auto-complete for reference fields
-
- UpdatedAug 1, 2024
- 8 minutes to read
- Xanadu
- Platform Field Administration
By default, a reference field auto-completes as the user types in the field.

Dictionary attributes for auto-completion of reference fields
There are dictionary attributes that are specific to reference fields and that determine auto-complete behavior.
Attribute | Description |
---|---|
ref_auto_completer | Specifies the name of the client-side JavaScript class that creates the
drop-down auto completion choices. Valid class values include:
|
ref_ac_columns | Specifies the list of reference table columns to display. Separate column names with a semi-colon. For example, ref_ac_columns=user_name;email;sys_created_on allows auto-complete to match text from the user_name, email, and sys_created_on columns. |
ref_ac_order_by | Specifies the reference table column that sorts the auto-completion choices. For example, ref_ac_order_by=name sorts the auto-completion choices alphabetically by name. |
Auto-complete UI features
The AJAX table completer class has a number of UI improvements.
- The table completer always displays the number of records the auto-complete query finds.
- The table completer highlights the entire selected row by changing the color of the background and text.
- The table completer lists a value for every column.
- The first time a value appears in a column, the table completer displays it in black text.
- The table completer displays subsequent duplicate values in grey text. Previously, the table completer displayed an empty cell in a column containing a duplicate value.

Set the ref_auto_completer=AJAXTableCompleter dictionary attribute to use these improvements.
Define auto-complete attributes for all references to a table
A field inherits and uses the reference table's auto-complete attributes unless the field has its own value for the same attributes. You can define the attributes for references to a table, and it affects every form that references that table.
Before you begin
About this task
A field-level attribute overrides a table-level attribute of the same name. If a field uses different reference attributes from those that are defined for the reference table, then the field uses both sets of attributes.
Procedure
What to do next

Remove the display value column
You can remove the display value column from a reference field by setting the ref_ac_display_value attribute to false.
Before you begin
About this task
This example describes how to remove the display value column from references to the User [sys_user] table and replace it with references to the first_name and last_name columns.
Procedure
What to do next
Improve auto-complete queries
By default, all reference fields use a starts with query to search for matching text in the reference table. This prevents auto-complete from executing inefficient contains queries every time a user searches a reference field. You can require all reference fields to use a starts with query.
Before you begin
About this task

This procedure describes how to change the glide.ui.ref_ac.startswith system property to always use a starts with query.
Procedure
Configure auto-complete to match text from any reference field
By default, auto-complete only matches text in the display value column. You can configure a reference field to match text from any additional column the reference field displays.
Before you begin
About this task
You can add the ref_ac_columns_search attribute to enable auto-complete to match text in any column listed in the ref_ac_columns attribute. Set the ref_ac_columns_search attribute to true to match text from all reference field columns. By default (or when this attribute is false) auto-complete only matches text in the display value column.
Procedure
Example
Enable contains auto-complete searches
By default, the reference auto-complete uses a starts with search. A user preference can be created to implement a contains search.
Before you begin
Procedure
What to do next
Wildcards in reference auto-completes
Wildcard searches use the auto-complete functionality.
Use an asterisk in the reference field for wildcard searches.

If two asterisks are entered, a list of available records display in the auto-complete suggestions.

On this page
- Dictionary attributes for auto-completion of reference fields
- Auto-complete UI features
- Define auto-complete attributes for all references to a table
- Remove the display value column
- Improve auto-complete queries
- Configure auto-complete to match text from any reference field
- Enable contains auto-complete searches
- Wildcards in reference auto-completes
Related Content
- Wildcard characters allow searching for patterns and variations
Expand search results to match any non-space character. Zing supports both single-character and multiple-character wildcards.