Enhance your Flows with Data Tables – Part 4

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.

The unofficialsf.com website includes datatableFSC as one of many Flow Screen Components you can use for your own organization.

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 4: Inline Editing

In November of 2019, Kirill Boyarkin, updated this component to support inline editing. Now you can specify individual columns as editable and the changed values will be passed back to your Flow so you can update the object records.

In this example, I created a simple Flow to present a list of Account records with the Annual Revenue column set to editable.

The Get Records node populates an SObject Collection variable with the records and fields I want to display in my datatable.

I pass that collection into the datatableFSC component on my Flow Screen, define the columns I want to display and set the Revenue column to be editable.

This component has a lot of attributes, so make sure you assign any output attributes in the Output Values section. For my output attributes, I select “Manually assign variables (advanced)” and assign my new SObject collection variable to the same Collection – Accounts attribute I used to pass in my records.


NOTE: The output attribute for selected records (Output Selected Accounts) is only used for identifying selected records in the datatable and may not contain the updated values. When you are combining editing and selecting in a single table, use the “Output Selected Accounts” attribute to get the list of selected records and their IDs and use the “Collection – Accounts” attribute to access the edited records.


The final Update Records node in my Flow is to update the Account object with my collection of edited records.


If you Show the checkbox column with your datatable, you will be able to select multiple rows and optionally apply an edit to all of the selected rows.

By default, the component will display Cancel and Save buttons once you start making edits. You can bypass this option by setting the “Show Save and Cancel Buttons?” attribute to False. Any edits will then be automatically saved once you hit the Next button.

Note: If there are a large number of records in the datatable, the Next button will always display at the bottom of the screen, but the user will have to scroll to the end of the table to see the Cancel and Save buttons.


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.



252 thoughts on “Enhance your Flows with Data Tables – Part 4

    1. Hi Eric, I tried starting from scratch today and it worked.. I swear I was doing the exact same thing.

      Appreciate your help on this!

      Like

  1. Hi, we are loving this component but are running into issues with the current limitation on long text area fields not being editable in the table. Any chance that is a feature coming in a future release?

    Like

    1. There are no immediate plans to add this but you can use the Datatable to select a record and combine that with the recordDetailFSC component below the Datatable to display and edit the configured field(s) for the selected record.

      Like

      1. Yeah this is an option but we were using the table because there could be many many records that need to be updated and looping through a screen per record would take a long time. It may be the only option or we go back and say they just can’t edit that field via the flow, which is less than ideal.

        Like

  2. Hi Eric,

    Great tool! One of the columns I have added to my datatable is a lookup(Contact), I set it to editable in the datatable configuration in my screen flow – however it is the only field I cannot edit. I haven’t found any information about limitations for editing lookup fields so I am wondering if this is by design or if I am missing something.

    Thanks!

    Like

  3. The OwnerId field is showing the id of the user instead of the fullname. Is there any way I can use a fullname? Thanks!

    Like

    1. In order for a lookup or master/detail field to display as a link, it must be “reparentable”

      In order to have the Datatable display a Lookup field as a link to the record rather than just the recordId value in the field, the running User must have Edit access to the object whose records are being displayed in the Datatable. For example, if you have a Datatable for Contact records and include the AccountId(Lookup) field, the running User needs to have Edit access for the Contact object in order for the AccountId field to show as a clickable link with the Account’s Name. Without Edit access to the Contact record, the Datatable will display, as unclickable, the Account’s recordId value.

      Like

  4. Hi Eric,

    Love your work! Having issues with Price Book Entries not committing when saving. Have a basic data table, with a get records on the PBE based on filter criteria. Table bringing back the rows and List Price, however when changing and hitting save, nothing happens in the back end. The flow debug doesnt seem to recognise the change.

    Any thoughts?

    Thanks!!

    Like

    1. The Datatable component does not update the actual records in the org. It passes back a collection of edited records that you then have to pass into an Update Records component if you want to commit the changes to the database.

      Liked by 1 person

  5. Hi, I love the flexibility of the datatable, but I’m currently struggling with the output.
    It seems that no matter what I do (default output collections, custom collections, serialised rows. I never get the output I need.

    1. It seems only the first record ID is passed back, an equal amount of times I had records selected in my table.

    2. I have a record collection in which I want to update a currency field, when I do so through datatable and click save, I see the values jump back to the old values.

    Any advice would be greatly appreciated.
    Thanks!

    Like

  6. Hi
    Thank you for this very useful tool.
    Like Michael (13/11) I am using a datatable to capture updates to Price Book Entries.
    I do not want to update the original PBEs as I am using the datatable to capture data to create new PBEs.
    I am going straight from the Screen input to a loop to assign the values ready to create new records.
    When I try and assign the values I get the original record value not the edited value.

    When I debug the flow I can see in the Screen section that the change is in the following section:
    ‘Outputs:
    numberOfRowsEdited = 1
    numberOfRowsSelected = 1’
    however in the ‘outputSelectedRowsString = ‘ section the fiel value is the original value.

    I fully appreciate I am probably missing something obvious, but can you please advise how the updated field should be referenced in the loop that follows?

    Many Thanks

    Like

  7. According to the documentation we should be able to select multiple lines and “mass” update the values of a specific picklist field for each in one go.

    Unfortunately I do not have the option to selected  the updated to apply the changes for all selected items.

    Is there a setting that I’m missing? This is for our end users they most important requirement.

    Like

      1. We do not use record types in this object. So there is no filter on record types

        I’ve understood that mass edit is possible on text fields but not on picklists. Is this correct. We only have picklist value fields in the data table that we display.

        The biggest ask now from our user group to have this working as now they need to edit record by record

        Like

    1. Can you please confirm where in the documentation the “mass” update functionality is covered? Because of limitations in the base Salesforce data table lightning component, I’m unable to support the mass update when inline editing picklist fields.

      Like

Leave a comment