Lightning Flow Screen Components are a great way to add power to and improve the look of your Flows. In this three-part series, I’ll show you how a single component, designed to display a list or table, can enhance your Flows.
This component is derived from the datatable Lightning Base Component. I recently enhanced Alex’s component to be more powerful and Admin friendly.
I will be showing you some examples about how the Datatable component:
- Can be used in place of a Record Choice Set (Dynamic Record Choice) for selecting a record while displaying more than a single field
- Can be used to select multiple records from an object then perform additional actions on them
- Can be used to present your data in an interactive and visually enhanced format
Part 1: Selecting a Record
When I first built this flow, I used a Record Choice Set (Dynamic Record Choice) in my screen to present a list of records to make a selection from.
A common issue Admins run into with this type of input is that one is restricted to displaying just a single field from the record when presenting the selection. Like many Admins, I created a new custom field in my object to combine the values of multiple other fields so I could show more information in my selection prompt.
This type of selection is awkward and you are not able to make the information line up from one record to the next.
Here’s what happens when I replace the Record Choice Selection with a Datatable Flow Screen Component.
See https://unofficialsf.com/datatable for complete information and instructions on this component.
My Flow looks up a collection of records to display in the table and passes that parameter to the component.
Note: Even though you are displaying a table for a single object, parameters are available for 8 standard or custom objects. This is to allow an Admin to easily use this component with no Lightning Component source code customization required.
I define the structure of my table by providing field and formatting information for up to 10 columns.
When the user clicks Next, the component can pass a collection of the selected records back to the Flow.
Now the user sees a formatted table with a checkbox available to make their selection.
The Flow then uses the values it needs from the selected record to complete its processing.
See the complete series on how you can use the datatable Flow Screen Component in your Lightning Flows.
Part 1 – Use a Datatable to present a dynamic choice for record selection in a Flow.
Part 2 – Use a Datatable in a Flow to select and act on a collection of records.
Part 3 – Use a Datatable to display a formatted, interactive table in your Flow.