With an autocomplete you can let users start typing into a field, and after they’ve entered a few characters, display an automatically refreshing list of suggested matches. This is much better than forcing them to go out to a separate lookup program to retrieve or confirm a value. This feature also works well for people who know exactly what they want to enter – they can just keep typing and tab to the next field when they’re done, without interruption or having to lift their hands from the keyboard.
In the video example Scott further limits the subset of cities based on the State field on the page. You will also pick up some tips on building SQL queries in Presto, using parameters, and incorporating screen data into your SQL queries.
Autocompletes are one of the most useful enhancements you can add to your modernized applications.
Very roughly speaking, in data entry there are three categories of information:
- Fields with very limited options. These can include Y/N flags, the months of the year or other limited options you would list right on a screen. In online input forms these can be effectively handled with radio buttons, checkboxes and dropdown lists.
- Fields with near-infinite options. Other fields have such a huge range of valid values that no one could remember or guess them. For completely unstructured data, you would use input fields or text areas, or in cases where the user is selecting from a huge data set, perhaps lookup programs with multiple filters.
- All other input fields. Autocompletes are a great feature for this third category – any field that a human will start to learn the patterns to and be able to at least partially guess.
As you can imagine, this type of field is very common and as a result you’ll have noticed that autocompletes are now ubiquitous on the web. Your users will certainly expect to find them in your web app too!