On List Select
Last updated 25/07/2025
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
