The independent daily for Salesforce admins, developers and architects

Curated by Abhinav (opens in a new tab)

Recommended

Combining Selected and Edited Data Table Rows in a Screen Flow (opens in a new tab)

You will learn why a Data Table's Selected Rows and Edited Rows outputs must be merged to get the chosen records with their updated values.

Why read this

You will also see two ways to do it: a single Transform element, which drops unedited selections, and a Loop with Collection Filter, which keeps every selected row.

  1. Loop over Selected Rows
  2. Collection Filter on edited Id
  3. Decision: match found?
  4. Assign edited Quantity
  5. Add row to new collection
Option 2 merges the two outputs by looping over the selected rows

The standard Data Table component in Screen Flow can return selected rows and edited rows as two separate collections. The Selected Rows output holds the records the user picked but not their edited field values, while the Edited Rows output holds the changed values whether or not the row was selected. Neither output alone gives the set of selected records with their updated values, and the component does not offer a single combined output.

The article’s example is a screen where users pick Price Book Entry records and enter a quantity for each, using a custom Quantity field. The author notes that a user can edit a row without selecting it, or select it without editing, so the two outputs must be merged to get the list the flow needs.

The first option uses a Transform element with the two outputs as sources, joined on Id. The Quantity must be mapped from the Edited Rows collection to get the user’s value. This is simple and needs no loops, but it performs an inner join, so a selected row with no edit is excluded. The article suggests this fits when every selected row is expected to be edited.

The second option keeps all selected rows. A Loop runs over Selected Rows, a Collection Filter finds any matching edited record by Id, and a Decision checks whether a match exists. If one does, an Assignment copies its Quantity; if not, the original values are kept. Each row is then added to a new collection. The author says this uses more elements but gives more control. The choice depends on whether unedited selections should be kept.

Read the original at Salesforce Time (opens in a new tab)

Worth reading?

Recommended

Showing an Apex Collection in a Screen Flow Data Table without a Custom Object (opens in a new tab)

You will learn how to define an Apex row type, return it from an invocable action and bind it to a Screen Flow Data Table with a Unique Identifier, avoiding helper objects.

Why read this

You will also learn the current limit that inline editing is not yet supported.

  1. Define row class with @AuraEnabled fields
  2. Return list from invocable action
  3. Store output in Apex-typed collection variable
  4. Bind to Data Table with Unique Identifier
How an Apex collection reaches a Screen Flow Data Table

Since Winter ’26 (API 65.0 and later), a Screen Flow Data Table can take a collection of an Apex-defined type as its Source Collection. Choosing a field as the Unique Identifier lets the table treat each item as a record, so users can select rows and the flow can reuse them. Display and selection work now, but inline editing for these collections is still pending.

The article contrasts this with older workarounds: creating a Custom Object that mirrors the Apex class, inserting and deleting temporary records, using a Transform element, or building a custom Lightning Web Component. Each works but leaves extra metadata to maintain. The walkthrough shows a sample FxRate class with @AuraEnabled fields, an invocable GetFxRates action that wraps the list in a result class, and the flow wiring that stores the output in a collection variable and feeds it to the table.

The author advises choosing a stable, unique key such as a record Id, an ISO currency code or a business key as the Unique Identifier, and generating one in Apex if the source has none. The pattern suits currency or stock quotes from an external API, financial calculations resolved in Apex, and batch results that should not be persisted.

Read the original at dev.to (opens in a new tab)

Worth reading?