On List Select
Last updated 26/03/2026
Overview
The On List select event is a client-side event that executes when a user selects a value from a lookup. It allows the application to immediately respond to the selected record.
How it Works
When a user interacts with a lookup field:
- The lookup list is displayed.
- A user selects a value from the list.
- The On List Select event executes.
- You can access the selected record's values.
- Logic can run based on that selection.
This is especially useful for auto-filling related data without requiring the user to manually enter it.
Use Cases
- Auto-populate related fields
- Run logic the moment a value is selected
- Improve user experience
Example
This function executes
This documentation will demonstrate how the On List Select event works. The On List Select event is a client-side event. When selecting a value in a lookup, the function attached to the On List Select event will execute.
The Orders application is used to demonstrate the On List Select event.
Execute an On List Select Event
The GetProductPrice query gets the ProductKey, Name, and Price values from the Product table. The product names will be listed in the Product's field lookup on the Order Items form. The Price query field is provided as metadata to the Order Items form when attached as a _LookupQuery, providing the price of the selected product. This metadata can then be used by a function attached to the form.
SELECT
Product.ProductKey AS ProductKey,
Product.Name AS Name,
Product.Price AS Price
FROM
Product
The GetProductPrice query is saved in the queries view in Five.

The
function GetProductPrice(five, context, result) {
five.field.Price = five.getMetadata('ProductKey', 'Price');
return five.success(result);
}
The

The GetProductPrice query is attached to the Product field with a display type of _LookupQuery on the Order Items form. The metadata provided to this field can now be used by the

The


In the Orders application, you can see all the products and their prices listed in the Products view. If we select a customer and drill down to place an order on the Order Items page on the Orders form, when a product is selected in the lookup list the On List Select event executes the
