Lightning Flow Screen Components are a great way to add power to and improve the look of your Flows. In this four -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 the base 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
- Can be used to display and inline edit a collection of records
Part 3: Displaying Tables in a Flow
How often have you had to use special formula fields or resort to building text output one line at a time in your flows to present a list of records?
In this post I’ll show you how to use the Lightning Datatable Flow Screen Component to turn this:
I have an application where I wanted to use a Flow to display data from three separate objects on a single screen. In the original version of this Flow I created a text variable for each table and used a text template variable to insert each line into the table. Formatting was a challenge and alignment was impossible with this method.
Each table is created with a separate text variable.
The tables are built by appending a text template to the variable for each record.
The Text Template variable is used to append each of the tables fields together.
The final result includes all of the information, but it is not very easy to read.
Other than a few Display Text sections, this screen is composed entirely of Lightning Flow Screen Components.
The horizontalRuleFSC components are used to add color and separation between my datatableFSC components and the navigationButtonFSC presents three custom buttons on the bottom of the screen. The selected button determines what part of the Flow executes next.
The datatables are configured by providing the parameter values for the input and output sObject Collection Variables and each column is configured with parameters for field name, label and type along with optional parameters for alignment and width.
The final result gives me a Flow that I can use to view and interact with my tables. I can sort any column in any table, I’ve added logic that allows me to select, then hide rows in any of the tables and I can select special processing to adjust the type of hierarchy used and then re-display the tables.
Here’s the Flow in action.
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.
Part 4 – Use a Datatable to inline edit a group of records.