Step by Step Guide to Using Data Table in Salesforce Flow

Data Table in Salesforce Flow

Salesforce Winter ’23 Release introduced “Data Table” in Salesforce Flows. With data table, you can display multiple records in a Screen-Flow, let users select one or multiple records and process the selected records based on your business requirements. Or you may just want to display a list of records without providing the option to select anything.

Here are some of the use cases for the data table

  • Let users select a list of records and then update those records with specific values
  • Let users select a list of records and delete those records
  • Or just display a list of records based on certain criteria

Before the data table, you needed to write custom code using Visualforce page, Aura, or Lightning Web Component to meet the similar requirements. But do note that currently there is no option to edit the values directly in the data table.

The data table can be created using the ‘Get Records’ element or using resource of ‘Collection’ type.

In this step-by-step guide, we will allow users to create multiple Contacts for an Account, display the newly added Contacts & existing Contacts in data table and let users ‘unselect’ the newly added Contact if they don’t want to save it.

This guide is just an illustration of how to use data table in Salesforce Flow in just under 30 minutes. And you can then let your imagination run wild and explore how this feature can be used to meet your business requirements and potentially reduce some of the custom codes.

Please do note that this feature is available in Winter ’23 Release of Salesforce, which will be rolling into production and sandbox orgs from 09-Sep-2022 to 14-Oct-2022. So be sure to ensure that your org has been updated with Winter ’23 release before trying this out.

What are we trying to build

In the following video, let’s first see what are we trying to build?

Now, let’s build this Flow

Ok, now that you understand what we are trying to build, here the complete guide on how to build this screen-flow containing data table – step by step.

NOTE: Certain sections of the guide will appear as locked in the free preview. You can download the unlocked version of the guide in PDF format by subscribing to our “All Access” Pass through the link below.

Not an “All Access” Pass Member Yet?

Get Download Access to this & 150+ More Step-by-Step Guides with “All Access” Pass. A simple and single plan to access our entire library of courses, guides, workshops & masterclasses on Salesforce.

Introducing Mastering Salesforce Flows Training Course

Liked this post? We are now offering a complete self-paced, video-based training course on Mastering Salesforce Flows. The course comes with downloadable step-by-step PDF guides, unlimited access, free upgrades, community discussion area, free preview and more. For more details, please click here.

Need Help with Flows?

Need advice on Flows? I also offer advisory & consulting services on Salesforce Flows. So, whether you want to create new Flows or migrate existing automations (Workflow Rules, Process Builder, Triggers) to Flows, I can help you analyze, design, plan & review. To initiate a discussion, please submit the contact form here stating your requirement or schedule a discussion at this URL.

35 thoughts on “Step by Step Guide to Using Data Table in Salesforce Flow”

  1. Hi Ashish,
    Is there any way to provide input column in data table?
    For example ,I have a quantity field on product and i am displaying products and quantity field into data table and user can input quantity against the product that user selected in data table?

    1. Hi Marshal, currenlty the data tables are read-only. You cannot edit fields. Hopefully future releases of Salesforce will have this functionality. 🙂

  2. Hi,

    When I try to display a picklist value in the data table it displays a number rather than the text of the picklist. Is there anyway to display the text value of the picklist.

    Cheers,

    Steven.

    1. Hi Steven, I tested it out and the picklist values are shown in the data table. Please refer to the following screenshot.

      Picklist field in data table

      How’s the picklist values defined in your case? Are the “Values” and “API Name” both text?

  3. Is there any way to get the ids from the not selected rows?

    I would like to have a data sheet where you can select the clients for a marketing action. And it should work like this:

    Select Customers for Marketing Action -> All selected contacts would be marked as Receiving Marketing (checkbox = TRUE)

    Not Selected Customers -> All not selected contacts would either not marked or the mark would be deleted (So if the checkbox was previously was = TRUE it should now change to = FALSE)

    I am currently using two loops which first delete the checkbox from all contacts in the data sheet and then insert the new choices for the selected contacts.
    This leads to multiple Contact field updates (first deletion, then insert) which I don’t like. Any idea how I could get a nicer way to find out the contacts which have been not selected in the data sheet?

  4. In the row selection mode, when there’s only one row in the source collection, it uses a radio button style selection, which cannot be deselected. When there are multiple rows, it switches to a checkbox, allowing both selection and deselection.

    Is this behavior intentional or a bug? It seems logical to allow users to deselect a value even when there’s only one row, in case of accidental selection.

    1. Hi Ivo, my best guess will be that is intentional rather than a bug. Agree with you that the option to deselect the row would be nice. One workaround that I can think of is to add a checkbox on the screen below the data table with label “Clear Selection”. If the user checks this box and clicks on “Next” button, they should be routed back to the same screen using “Decision” element so that the screen gets refershed. See if this works for you.

  5. Hi! Is it possible to display the selection results of the data table in a screen flow after? Currently, it only shows the results of the selected rows in form of ids but I want to show it in a display text component. It only allows me to find the actual text name of the first selected row, not all the rows.

    1. Hi Maria, to display all the selected rows in a display text component, you will have to loop through the selected records and add the values to a resource. You can then use that resource in the display text component.

      1. Hi Ashish,
        Thank you so much for all the contents and your hard work behind it. Really appreciated!

        I have followed the exact steps from your slides. The flow is fetching the existing contacts but throwing an error as follows after clicking on ‘Next’ button:

        This page has an error. You might just need to refresh it. [Cannot convert undefined or null to object] Failing descriptor: {markup://flowruntime:datatable}
        Could you please let me know what is going wrong?

        Thank you.
        Pranjali

        1. Thanks Pranjali!

          I am not sure that the error means. You can try clearing browser cache and reloading the page. If it still gives error, please reach out to Salesforce Support.

  6. Hi Ashish,
    This was very helpful.
    I have a question as I am trying to use screen flow to get the record and i am able to fetch field values in the data table of existing record. But unable to hyperlink that record name as an link in Data table so that I can redirect directly to the record. How to do that? I need your guidance on this.

      1. Deepak Singhal

        Thanks Ashish.

        Could you please let me know if we can use this Hyperlink URL within Data table also.as I am getting related list as an opportunity from campaign. unable to hyperlink that record name as an link in Data table

        eg. we have data table with opportunity Details like Opp Name , Stage & Amount in columns.
        Want to have Opp Name as Hyperlink within Data-table.

        1. Hi Deepak, one option is to create a custom field of “formula” type that will have the URL to record and show that field in the data table. You will need to test and see if this works.

  7. Hi Can we have search textbox to search values in datatable or have picklist list viewabove datatable to see recently view records.

    1. Hi Arun, currently, there isn’t an out of the box feature to search for values in data table. But here is what you can try:

      1. Create a collection using ‘Get Records’ element to get all the records based on your requirement. Let’s call it “main collection”.
      2. Add a screen element and display a text box to let user enter the search string.
      3. Create a “Collection Filter” to filter the “main collection” with the search string entered by the user.
      4. Add another screen element to display the data table created on the “collection filter”.

      Also note that Salesforce will be adding “Reactive Screen Components” in Flows. Please refer to this Trailblazer Community group for more details – https://trailhead.salesforce.com/trailblazer-community/groups/0F94S000000kGWqSAM

      For recently viewed records, you can use the ‘Get Records’ element on the object ‘RecentlyViewed’, though I am not sure how useful this is going to be if you need to display the information about the recently viewed record.

  8. Ashish,
    Yet another great post! You are a great help.
    One question as you are one who always is in the know. Do you have any idea when Data Table will be able to take data entry? Specifically on creating Opportunity Products, adding a Quantity directly in the table?

    Thanks,
    Pete

  9. Hi. This was very helpful.
    Do you know if there is a limit on the number of objects displayed in a table? (or Get Records limit ? )
    Thank you

    1. Thanks for your feedback Timi. Glad that you found it useful. The ‘Get Records’ element has a limit of 50,000 records ( https://help.salesforce.com/s/articleView?id=sf.flow_considerations_limit_transaction.htm&type=5 ). But I am not sure if data table can display so many records and I have not seen any mention of limits for data table. You will have to test it out. The other factor to consider is that currently the data table does not have pagination. So, displaying a large number of records on one single screen will not be very user-friendly.

  10. Hi Ashish,
    This was very helpful.
    I have a question as I am trying to use screen flow to update the record and i am facing an issue the field values are not been fetched in the data table of existing record. How to do that? I need your guidance on this.

    Thank you,
    Pooja

    1. Thanks Pooja. Can you please clarify the overall approach as I am not clear? Data tables are currently not editable. So, you won’t be able to edit the values directly in the data table. Where exactly the field values are not being fetched?

  11. This was an excellent instruction for Data Table – Thank you! Once again, you de-mystify and make clear to we mere mortals the world of making Salesforce do what you want!
    Question: In putting my learning to work, I started simple and used Data Table to show the result of changing or assigning a geographical region to a set of zipcodes. Region names and other data are stored on the Account object; the Zipcode table is it’s own custom object. The flow works just fine- the assigned region is updated, and the Data Table shows the records that were updated (i.e. each zipcode) and the newly assigned Region. However, in the Zipcode object, Region is necessarily a Lookup field, and when the results display in the Data Table, the Region column is showing the ID of the Region, not its Name. This, of course, seems useless; the user needs to see the Name they selected. I can’t see a way around this – is there one? (Also, I would note, we’ve been using Unofficial Salesforce’s Datatable, and it does not exhibit this behavior – you get the Name when you specify a column that is a Lookup field.)

      1. I’ve tried using the formula/text field Owner.FirstName & ” ” & Owner.LastName and it shows up the information I’m looking for in the field on a page layout, but when bringing it into the data table the data is blank and missing. Could you advise? I also read about using this, but I’m not sure where to place this as I’m also getting a syntax error in the field. HYPERLINK( LEFT($Api.Partner_Server_URL_450, FIND(‘/services’, $Api.Partner_Server_URL_450)) + CASESAFEID(Id), $Record.Related_Record__r.Name ). Thanks

          1. Hi Ashish,

            I’m experiencing the exact same issue as Julia: formula/text value is shown on page layout, but NOT in the data table.
            Not sure why this fails, but it seems to happen for CROSS-OBJECT formulas. Can you please try it for e.g. custom formula field ‘Product Name’ (ProductName__c) with formula “Product2.Name” on the Order Product? (to display data table of existing Order Product records on the Order)

            Does that work for you?

            Thanks,
            Tommy

          2. Hi Tommy,

            It does work for me. I created a custom formula field on the “Opportunity Product” object to get the product name.

            Formula field for Product Name

            And then I used this field in the data table. It is showing me the values.

            Display formula field in data table

          1. I also have tie issues with formulas. I created a hyperlink formula, it appears on page layout, but is empty in data table

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top
Introducing All Access Pass