Dropdown Filtering with Formulas

The Formulas tab can populate a filter or a field value dropdown list by specifying a query.  The list of values displayed in the dropdown can be retrieved from a foreign key table, or another table or view.  A WHERE clause can be specified to restrict the values, and an ORDER BY clause can be specified to show the values in a specific order.

In the above example, the ProductID dropdown list on an Add Order Details page is restricted to only show products that are not discontinued.

Both field value dropdowns and the filter dropdowns provide the ability to specify a WHERE and an ORDER BY clause.

The dropdown list can also contain static values that are entered by the developer.  By default, only the “Please Select” value is specified initially for field value dropdowns, or the “All” for the filter dropdowns.

The static list is combined with the list retrieved from the database and displayed in the dropdown list.  The elements in the static list are always shown above the database items, and they are in the order specified.  The elements in the static list can be reordered with the Up/Down buttons shown below the table.

See Also

The Formula Language

Data Validation with Formulas

Dropdown Filtering with Formulas

Common Formula Examples

Cross-site Scripting and SQL Injection Attacks

Formula Run-Time Performance