Advanced Options On Data Bound Lists
When a Select component is bound to an external data source, controlling the amount of data loaded into the list is critical to overall performance. GlobalForms allows requests for external data being loaded to be both limited in size and returned in pages, assuming your data source can support these options. When using SQL Server data binding native to GlobalForms, SQL queries may be written in a way to support this behavior.
Use a list with limits and allow it to page through results
On the select component's data tab, form designers can specify a Limit. When the request to get the data is made, the Limit and the current data page is passed in the request. Use the SearchQueryName parameter to allow the user to type into the list and filter what it shows.
In the example below, there are 9 items in a list. The limit of 3 is set (of course, in production set this to a much higher number that correlates to the environment's performance threshold). The user can continue to click "Load More" to get more data into the list. Alternately, the user can type into the list so it will load just the items that match the filter. Be advised that filtering currently does not apply to the Load More behaviors, so the expectation is the filter result would be within the confines of your set limit.
In this case, use a SQL query configured in GlobalForms for return the appropriate data:
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 }};
For reference, the data tab for this example should resemble the following: