Requests for new business applications often begin with basic lists of data — a perfect use case for a Nitro App Builder grid widget — then grow from there. In some cases a requirement may entail allowing users to click on multiple records in the list, then take an identical action against all the selected records at once.
For instance, your marketing department might be seeking a list of active customers, from which a user would select a bunch of customers to send a special promotion en masse.
For this scenario, a grid widget with checkbox selections enabled might be ideal.
It's relatively simple to activate a checkbox column on a grid, and to add filters that allow users to limit grid records to those most pertinent to their objective. Users can then scroll through the filtered list, individually check off the desired records and click a button to act on them (see this prior blog post for an example of this concept in action).
But what if you could take things a step further and "pre-select" applicable rows that you know the user is likely interested in acting upon, based on some value in each row? This could potentially reduce the amount of tedious hunting and clicking your users must do. And as of the latest Valence build, pre-selecting rows is now an option in your grid apps!
This pre-selection concept is referred to in NAB as "Auto Select" and is activated in the App view of a Grid or Edit Grid widget. To access the configuration to turn on checkbox selections and set the auto select conditions, hover over the grid widget and click on the cogwheel, as illustrated here:
In the example below, only rows with a customer number over 1000 and a country other than "Canada" will be selectable by the user. Otherwise the checkbox will be disabled.
As described in the blog post referenced earlier, you'll also want to add a button to your grid to process the row selections in a back-end RPG program. In this example, we've added a button called "Send Marketing Message" to the grid, which will send all the selected rows to an RPG program called VXMKTMSG...
Note that while you're inside the NAB Designer app, the checkbox column is not rendered after being activated. But once you save and launch the app you and your grateful users will definitely see it. Here you can see all the German customers with under $50,000 in sales have been automatically selected...
Imagine the ways you can put this feature to work in your own apps to reduce the amount of hunting and clicking your users must do!