In the Salesforce Winter 23 Release, the “Data Table” flow component, in Beta, now allows one to select multiple records within a screen flow. Typically, I wait until something is GA to try it out but this feature is something I’ve wanted for years so let’s take a look…
For contriving sake, let’s say I want users to be able to select up to 10 of the most recently edited accounts. Start by creating a new Screen Flow, add a screen element and then add a Data Table to the screen. This results in something like this:
Configuring Source Collection
The Source Collection tells the data table where the records come from. One thing to note is that the Source for the Data Table has to be a record collection! When I first tried creating a new “resource” from the Source Collection input, it showed the following options:
However, none of those can actually be chosen! I tried creating a “Collection Choice Set” but that did not work. After adding a Get Records with multiple records being queried, then that could be used in the “Source Collection”. For example, to grab the latest edited accounts, the following Get Accounts was created:
Now the “Get Latest Accounts can be chosen in the Data Table’s “Source Collection”. It would be really nice if the Source Collection didn’t give you options that are useless in this context!
Row Selection Mode
One can decide how many rows can be selected using the “Row Selection Mode” settings. Since one can select up to 10 records, “Multiple” was chosen, a minimum row selection of 1, and a maximum row selection of 10 was entered.
Configure Columns
One can configure which columns show and in which order in the Data Table. Here’s the starting point:
One first chooses a “Source Field”, enters the Overflow Mode, which defaults to “Wrap Text” and can optionally override the header column label. After entering the options for the field, click “Done” and it gets added to the list. For example, here’s what the UI looks like after configuring the “Name” field:
To add another field, click the “Add column” button and repeat the same steps.
Sample Accounts Data Table For Multi-Selection
One can click the “select all” to choose all the records. Since at least 1 account is needed, the following error message is shown when “Finish” is clicked:
It would be nice if the error message was more clear like “Please select at least 1 row”.
Using the Selected Rows
After one chooses one or more records, the flow should do something with it. One can use the selectedRows collection variable from the Data Table later in the screen flow as needed. For example, here’s a screen showing the selected record ids that are in the “selectedRows” collection.
Here’s what outputs to the screen:
Initial Thoughts
- The Data Table is nice overall! It can certainly use some polish, especially around the Source Collection and minimum record selection error messaging. However, it’s good enough to start using for 1 or more records being selected in a flow!
- Also, the column management was counter-intuitive for me but adapted quickly. At first, I was trying to click the “New Column” input that was disabled but then realized that that is the “header” for this.
- Further exploration is needed to see how this would work on a mobile device like a phone or tablet.
What are you first impressions? Would you use this in your flows now?