Examples for using autocomplete with source CSV or a database.
An autocomplete can be used with different predefined functions of FORMCYCLE. In the following examples the different possibilities are showed in detail.
Database query "states_data_starts_with":
SELECT name, id_state, capital, CONCAT(name,' (',capital, ')') as name_capital FROM state WHERE name LIKE CONCAT(?,'%') ORDER BY name;
Federal states (from Germany) - beginning with...
More information about autocompleteDB function can be found at the following link.
Type Federal states (from Germany) but select Capital
Federal states (from Germany)
Capital (filled by states)
Zip (min. 2 digts)
City (filtered by zip)
The input city will be editable after a federal state is selected.
Database query "city_data_by_state_filtered" for tfCity:
SELECT name, id_city FROM city WHERE name LIKE CONCAT(?,'%') AND id_state = ? ORDER BY name;
City (filtered by states)
The following setting is completely possible via the Designer. The following steps are necessary:
If the field is not set as required, you have to set the option show standard value, otherwise the value returned first will shown. The defined data source is database query "state_data":
SELECT name, id_state, capital FROM state ORDER BY name;
Federal States