Data Binding Drop-Down Controls Using a Lookup Name (Parameterized)
- Last UpdatedJun 25, 2024
- 1 minute read
You can populate the options of a drop-down control that is options binding, using a parameterized lookup name.
You can use any type of lookup (Database, Repository List or Web API for data binding options of Check Box, List, Drop-Down, or Radio Button control.
-
Create a lookup with the name Products that is parameterized on Productcategory
Let us consider that Products is a Database lookup with the following configuration:
Query- select * from Products where ProductCategoryKey = @key
Value- Products.ProductKey
Display Name- ProductName -
Add a Drop-Down control to the form.
-
Modify properties of the Drop-Down control as follows:
-
In the Advanced tab, set the Text Parameter to ProductName and Value Parameter to ProductKey.
-
In the Scripts tab, set the script for the Options property as follows:
var parameterCollection = [
{
Name: "@key",
Value: "Bikes"
}];
var lookupSchemaAndData = SFU.getLookupSchemaAndData("Products", parameterCollection);
return lookupSchemaAndData.Data;
-