Introducing QuickQuery, the extension that turns Flow into the best List Views

Note: The functionality shown in this post currently requires that orgs be enabled for the Reactive Screens pilot.

QuickQuery works with data presentation components like Datatable and FlexCard to provide innovative, easy-to-use List View solutions. Let’s take a look:

Here, we’re looking at a screen flow on a record page. The screen being shown has a QuickQuery component on top and a Datatable component below:

You start by selecting the object you want to work with:

For each column that you’re currently showing, a ‘Filter Button’ appears. Use those to create fast filters, like this:

As you can see above, as soon as the filter expression is created, QuickQuery immediately runs a new query and passes the results to one of its outputs. In this Flow screen, the Datatable component is configured to take that output as an input. Because Reactive Screens is enabled on this org, the Datatable immediately updates to show the filtered results.

Columns and Sorting

Click the gear icon to choose the visible columns and set the sort order:

Creating, Updating and Using Views

A QuickQuery View consists of the Column and Sorting choices, plus the Filter Expressions. You can persist a view by clicking Save view:

Doing this will create or update a set of 3 records:

A FlowTableViewDefinition record stores information about columns, sorting and other table configuration data. This is used for Datatables in general and isn’t specific to Query Query.

A QuickQueryConfiguration record combines a reference to a FlowTableViewDefinition with configuration information specific to this component, such as which object is selected.

A FlowPersonalConfiguration record ties the QuickQueryConfiguration to a User ID. This ensures that when you load this component, you’ll only see the views you created, and not someone else’s view.

Exporting to CSV

An Export to CSV button has been added to QuickQuery to provide an easy way to quickly export sets of records

If you wire the output of a supported data component up to the input of QuickQuery, you can use the Export to CSV function by clicking on that button. Note that in order to make this work, you need to wire the output of the Datatable back into the input of Quick Query, so the Export button knows which records to export.

Wiring up the Pieces

Taking advantage of reactivity is all about wiring the right outputs to the right inputs. Learn more about reactive wiring here.

How it Works

QuickQuery takes the following inputs:

objectNameallows you to preset the object that the component is set to when it first loads
quickRecordViewIdQuick Record Views are saved as records and can be retrieved. If you pass in the id of a Quick Record View, it will be loaded automatically when the component loads.
recordDataStringAll
recordDataStringSelected

Installation:

Step 1: Install prerequisite extensions

Install Screen Components Base Pack and Action Base Pack version 3.0.6 or higher for Screen Components, and version 3.0 or higher for Actions

Install Datatable 4.0.3 or Later

Install Collection Actions 3.0.0 or Later

This component uses the Upsert and Get Records From Ids actions, found in the Collection Actions package to save changes to the view configuration

Step 2: Install this QuickQuery package.

Version 3.01 5/20-22 Initial Release

Old Release

Version 1.0 3-13-22 Initial Release

Step 3 (Optional): Add the Quick Query Deployment flow to a Lightning Page

This package comes with a sample flow “Quick Query Deployment” that can be added to pages. Here, I’ve added it to a Home Page by adding the Flow component and pointing it at Quick Query Deployment flow:

Here’s what that looks like when the page is loaded:

At this point, you should be able to select an Object and see the results show up automatically. If no results are displayed, verify again that your org has the Reactive Screens pilot turned on!

View Source

source

Developer Notes

Several new custom objects have been defined as part of this project:

QuickQueryConfiguration

QuickQueryConfiguration is specific to QuickQuery. It encapsulates the settings specific to a particular object. When you select an object in the object picker, its QuickQueryConfiguration is accessed to determine the current filter settings and the underlying FlowTableViewDefinition

FlowTableViewDefinition

This is a renamed version of the ers_DatabaseConfiguration object that was created for Datatable by Eric Smith. The purpose of this object is to define a table view, including things like the columns and their sort order. We anticipate that FlowTableViewDefinition can be used as a common standard across Flow extensions by anyone working with views. Note that this object is actually defined in Flow ScreenComponents Base Pack.

FlowPersonalConfiguration

The goal of this object is to provide a common way to allow individuals to personalize their experience. In the example below, a particular User, reflected by the general Actor ID, is linked to a particular QuickQueryConfigurationName (shown as an id here):

When QuickQuery initializes, it wants to start with the configuration last used by the user that’s running. So it queries to see if there’s a FlowPersonalConfiguration for the running User. If it finds one, it looks to see if any of the 10 available keys match what QuickQuery uses. If it finds one, as is the case above, it will load that particular QuickQueryConfiguration. This mechanism is designed to be used by multiple products. Basically, any product can query for FlowPersonalConfiguration and store configuration values in available ‘slots’. . Note that this object is actually defined in Flow ScreenComponents Base Pack.