When a Select component loads its options from a URL or a resource, loading the whole list at once can be slow. GlobalForms can load the list a page at a time and search as the user types, if the data source supports it.
How it works
-
Limit sets how many items load at a time. When there are more, the list shows Load More.
-
Each request tells the data source how many items to return (
limit) and how many to skip (skip). -
Search Query Name is the name of the parameter that carries what the user has typed, so the data source can return only matching items.
-
Disable limiting response stops the Select from adding
limitandskipto the request. Turn it on when the data source rejects those parameters or always returns the full list.
Typed searches only filter within the data source's results. If your data source ignores the search parameter, the user is searching only the items already loaded.
Example: a paged SQL lookup
A Select lists vehicle makes from an SQL lookup route. On its Data tab:
|
Setting |
Value |
|---|---|
|
Data Source Type |
URL |
|
Data Source URL |
The lookup route, for example |
|
Search Query Name |
|
|
Limit |
The number of items per page, for example |
The route's query uses the paging and search values:
WITH VehicleMakes AS (
SELECT DISTINCT make, ROW_NUMBER() OVER (ORDER BY make) AS RowNumber
FROM Vehicles
WHERE make LIKE '%{{ query.lookupitem }}%'
)
SELECT make, RowNumber FROM VehicleMakes
WHERE RowNumber BETWEEN {{ query.skip }} + 1 AND {{ query.limit }} + {{ query.skip }};
The '%{{ … }}%' pattern is the one case where a placeholder goes inside quotes; GlobalForms handles it specially. Everywhere else, don't put quotes around {{ }} placeholders. See Setting Up SQL Lookups (Resquel).