The Three Musketeers Arrive in Winter ’23: Data Table (Beta), IN Operator, and Record Type Filtering for Picklists

It’s time to bust out the Salesforce Confetti animations and celebration gifs – I am beyond excited to announce three extremely popular requests are making their way to Flow in the Winter ‘23 release! 

Stay tuned for more information on what’s coming in Winter ’23, but for now, enjoy some juicy release nuggets.

Let’s dive in.

Out of the box Data Table Arrives (Beta)

You asked, we’re delivering! Back in October we put out a community-wide survey asking for feedback about our screen flow roadmap, and the #1 request by far was an official Datatable component. Due to the overwhelming responses and consistently high usage of custom Datatable components across all screen flows, we decided to bump it up in priority. 

In Winter ‘23, you can now add the Beta release of our Data Table component to any screen flow. If you had sharp eyes, you may have noticed I actually used a preview version of this in my Release Readiness Live demo for Spring ‘23.

Keep in mind that this is beta, so we are still working on it but we welcome any and all feedback!

What’s a Data Table?

Chances are pretty good because you’re here on UnofficialSF you’re quite familiar with what a Data Table is, but just in case…

In the Flow world, you can populate a Data Table with a collection of records and take action on them in a subsequent screen. In a selection use case, think of them as Choices on steroids but you can select any number of fields from the object to display as columns.

Need to provide a summary screen at the end of your flow or a ‘Confirmation’ screen? We’ve got that covered, simply switch the table’s view mode into ‘No Selection’ to provide a clean confirmation screen to your users before doing any major Create/Update/Delete operations in your Flow. This even supports cases where the records have not been made in the database yet, which is something not available to many custom data tables. 

Data Table Beta Features

  • Table Header: Create an accessible label for your table and hide it from users so that it remains accessible.
  • Single Record & Record Collection Outputs: Selected records from the Data Table will be available as both a Record Collection and a Record Resource. 
    • Note: One key feature we built in is the ability to have ‘uncommitted’ records not in the database displayed on a table – A great way to implement confirmation screens where your users build collections of data in Flow before creating them in the database!
  • Selection Modes: Change the table selection mode to Multi-select (Checkbox), Single Select (Radio), or No Selection (View only)
Multi-Select Mode
Single Select Mode
No Selection Mode
  • Required & Default Selection Options: Ensure your users select the records you want by enforcing a minimum or maximum selection of records. When in Single Select mode, this changes to a ‘Required Selection’ checkbox. Also provide a record collection to act as a default selection upon entering the screen
  • Column Configuration
    • Drag/Drop Fields: Select the fields you want to display from the Record Collection’s object you choose in your table and drag and drop the column order all within the property editor 
  • Custom Header Labels: You can provide an alternative field label for any field you display to your users. This feature is especially important when displaying data to external users. 
    • Wrap/Clip Text: You can choose whether a field will wrap or clip its contents within the table. The default is Clip. 
  • Rich Text Field Support: The base lightning-datatable component does not support rendering rich text, but we built it in! You’ll be able to create beautiful looking tables that contain images and bulleted lists for richer screen experiences, including formula fields that use things like HYPERLINK and IMAGE! 

Considerations

Please note this is not a complete list of considerations and limitations – please check our official release notes and documentation for that as we update them.

  • Unsupported Field Types: Address and Location field types are not supported. To add address fields you will need to add each field individually (i.e. BillingStreet, BillingCountry, etc.)
  • Fixed Height: At this time, Data Tables are fixed at a 400 pixel height.
  • Mobile Compatibility: Like the base lightning-datatable component, the Data Table screen component is not mobile compatible.
  • Formula field re-evaluation: While not specific to Data Table, if you are displaying records that haven’t been committed to the database yet and you’re displaying a Formula field on your table, those formula fields won’t evaluate. Look into using an invocable action that can recalculate formulas or re-query your records (using IN operator!) to refresh your records and formula field values.
  • Related Record Information Unavailable: When placing a Lookup/Master-Detail field onto a table, the related record field information is not available (like a related record’s name). For now, use formula fields. If you need hyperlinked record fields, I’d suggest trying a formula field.

    For example you could use the following to display a related record name in the form of a hyperlink – HYPERLINK( LEFT($Api.Partner_Server_URL_450, FIND(‘/services’, $Api.Partner_Server_URL_450)) + CASESAFEID(Id), $Record.Related_Record__r.Name )

‘IN’ / ‘NOT IN’ Operators – 16,000 IdeaExchange Points

At long last, the ‘IN’/’NOT IN’ Operators arrive to Get Records, Delete Records, and Update Records elements. Make your flow canvas cleaner and scale with higher data volumes with these new operators. 

How It Works

In this first release, you can use any non record-collection on the right hand side of an IN statement – examples include a Text Collection, Date Collection, or a Number collection. The best way of describing ‘IN’ functionality is something to the effect of  “I want to retrieve or do something on a collection of records based on a set of values”. It is the best friend of Junction Objects. 

In a screen flow scenario, imagine running a screen flow where you want to display a Data Table of Contact records based on the Related Contacts for an Account. Those relationships are actually stored in the Account Contact Relationship junction object. In other words, what you actually want is “Show a list of Contacts that are in the list of Active Contact Relationships related to the account.” With IN, this is now possible without doing queries within loops.

Speaking of loops, you often hear “don’t put queries in your loops”. Until now, you really didn’t have a way to avoid that. Imagine a record-triggered flow scenario where an Opportunity closes and you want to update a field on a set of Account Team records for each person on the Opportunity Team. Before, you had to loop over the Opportunity Team and within the loop, query for a related Account Team member record. With ‘IN’, you aren’t forced into querying within your loop and can just query for the relevant Account Team members directly.

Supported Data Types for IN Operators

Field types on the left hand side of a Get/Delete/Update element must always match the field type on the right hand side. If you select a Date field on the left, choose ‘IN’, then the right hand side must also be a single date or a collection of dates. 

Here are the supported data types:

  • Text
  • Date
  • DateTime
  • Currency
  • Number
  • Boolean

Considerations

  • Be careful with the ‘NOT IN’ operator. Because it isn’t considered a ‘selective’ operator, you may unintentionally query too many records (<50,000) and hit governor limits. Do what you can to use ‘IN’ instead.
  • There’s an upper limit to how many characters can be on the Right Hand Side of an IN/NOT IN operator – if nothing else is in your Get Records, we estimate about 4,700 Ids per Flow interview, or 100,000 characters.

How Do You Generate a Text Collection?

Some components and actions like File Upload and the new multi-select capabilities of Lookup already output a collection of Ids – so you won’t need to do any conversion for those scenarios. 

Option 1: With Loops

Unless you’re using an invocable action or screen component that gives you a collection of Ids or text values, you will likely need to generate your own collection. The standard, out of the box way of doing this is a basic loop with a simple assignment. Create a Text (or date) collection resource and in your assignment, loop over the record collection you want that has your text and add it to your collection that you’ll use in your query.

Unfortunately this option is susceptible to Flow’s iteration limit and when dealing with higher data volumes (think 650+ records). Therefore I recommend checking out a better way – Option #2

Option 2 (Preferred): With an Action

The easiest and fastest way to do this is by using an invocable action like Extract Strings from Records (Trailhead Component Library) or Extract Strings from Collection (Part of UnofficialSF’s Collection Processor Package). 

Use Cases

Pass Selected Records from a List View into a Flow

One of my favorite use cases for ‘IN’ this release is how easy it is to run Flows from a List View. Many people have written articles on how to pass selected records from a list view into a Flow. Now in Winter ‘23 it’s far easier. Here’s how you do it:

  1. Create a new ‘ids’ resource of type Text Collection and check the ‘Available for input’ box . The platform will automatically pass in the selected records of the list view into this ‘ids’ resource.
  1. Perform a Get Records on the object you want using that ‘ids’ resource.
  1. You now have the records selected by the user available to you! You can do some nifty stuff like display it in Datatable, make mass edits to the records… the world’s your oyster!
  1. From the SFXD Wiki – Set up your button 

Query based on Ids from an Action or Screen Component

In some cases you may be using an invocable action that hits an external service, and that same action may return a collection of external Ids which are stored in records across your Salesforce instance. Your action may already return a Text Collection of Ids, if it does, awesome! You’re ready to go.

If your action returns a Comma-Separated String of values (CSV), you’ll need to convert that into a Text Collection. You can do that in your Apex class, this handy action (UnofficialSF) or this one ( Install Link – Trailhead Components). 

In Winter ‘23 the Lookup component gains the ability to select multiple records which will output a collection of Ids. Use the new ‘IN’ operator to retrieve whatever records you want based on the records the user selected.

Cleaner and More Scalable Text Queries

Imagine running a scheduled Flow that looks for specific Account names, Countries, or other text fields and either deletes them or flags them as ‘junk’ data. Previous to the Winter release, you might have a Get Records query that resembles something like this: 

In Winter ‘23, you’ll be able to create a Custom Metadata Type that contains a list of ‘exclusion’ terms and applicable countries, and then generate a text collection for each category using the custom metadata records you create with all the countries you want to include. . You’d never have to update the query again – just add a new custom metadata record with the name and country.

Here’s what this same query looks like with an ‘IN’ operator:

Record Type Filtering for Picklists Arrives in Dynamic Forms for Flow – 12,000 IdeaExchange Points Delivered

Last but not certainly not least, Picklists in Dynamic Forms for Flow are now record type aware upon entering the screen!

If a record resource has its RecordTypeId field set when entering a screen, any Picklist values that are dependent on a Record Type will now display the correct Picklist values. Nice.

How Can I Set a Record Type?

The classic way of displaying a list of record types is by using a Record Choice Set using the ‘RecordType’ object and specifying the Object in your criteria. You can also use a Collection Choice Set. Note that this will grant a list of all active record types for an object regardless of whether the running user has access to that record type.

We’re looking at potentially making Record Type available as something you can drag into a screen flow using Record Fields from Dynamic Forms for Flow. If that’s something that interests you, let us know in the Salesforce Automation Trailblazer Community or the IdeaExchange!