Salesforce: How to Display Apex-Defined Collections in a Screen Flow Data Table

Salesforce: How to Display Apex-Defined Collections in a Screen Flow Data Table

Winter '26 lets you use Apex-Defined collections as the source of a Screen Flow Data Table. What changes, how to configure it and where the limits are, with official sources.

Summarize this article with

TL;DR

Salesforce's Winter '26 release lets Screen Flow Data Tables display Apex-Defined collections directly, removing the need to transform complex data into standard objects. This simplifies showing HTTP call responses or Transform element results without creating intermediate objects. Although it does not support inline editing, it works well for displaying and selecting complex data, and it improves the integration between Apex and declarative flows.

On this page

For years, displaying on a screen the data returned by an Apex class had the same basic problem: the Data Table component in Screen Flows only accepted collections of standard objects as a source. If your logic lived in Apex, for example the response of an HTTP callout to an external API, you couldn't pass it straight to the table. You had to transform that data into records of an object, real or in memory, just to be able to display it.

The Winter '26 release of Salesforce changes that. We'll look at exactly what it adds, how it works and where its limits are. Everything below is based on official documentation, and the links to the sources are at the end.

What Winter '26 adds

The release note, titled "Display Complex Data with Apex-Defined Collection Support in Data Tables", confirms that Data Tables in Screen Flows now accept Apex-Defined collections as the Source Collection. Before, the source was limited to collections of standard objects. Now you can feed the table with the output of a Transform element or an HTTP callout, among other complex data.

In plain terms: the collection your Apex builds can go straight into the Data Table, without creating an intermediate object or saving temporary records just to display them.

A refresher: what Apex-Defined variables are

Apex-Defined variables have existed in Flow since the Summer '19 release. The idea is to let flows work with complex data structures, of the kind a web service call normally returns. A developer defines an Apex class that acts as a template, and the flow can handle those objects declaratively.

For that template to be visible from Flow, Salesforce documents two annotations:

  • @InvocableMethod identifies the methods that can run as invocable actions, for example from a flow.

  • @InvocableVariable identifies the variables those invocable methods use inside a custom class. Each annotated variable is, in practice, one of the fields you'll be able to show as a column.

A generic example of the documented pattern:

public with sharing class CotizacionAction {

    public class Cotizacion {
        @InvocableVariable(label='Codigo' required=true)
        public String codigo;   // identifies each row, for example "USD"

        @InvocableVariable(label='Moneda')
        public String moneda;

        @InvocableVariable(label='Valor')
        public Decimal valor;
    }

    @InvocableMethod(label='Obtener cotizaciones' callout=true)
    public static List<List<Cotizacion>> obtener() {
        List<Cotizacion> filas = new List<Cotizacion>();
        // The HTTP callout to the API and building the collection go here
        return new List<List<Cotizacion>>{ filas };
    }
}

The invocable method is static and public, and lives in an outer class. callout=true is used when the method makes HTTP calls. The double List is the Apex bulkification pattern: the method receives and returns a list per invocation, so to deliver a collection as output, the return type is a list of lists.

How to set it up in the Screen Flow

At a high level, the workflow is this:

  1. In your Screen Flow, add an Apex action that runs the invocable method and returns the Apex-Defined collection.

  2. On the screen, insert the Data Table component.

  3. In Source Collection, select that Apex-Defined collection.

  4. In the Configure Rows section, choose a field as the Unique Identifier, for example the code or an id.

  5. Define the columns to display and, if you need it, enable Row Selection so the user can choose one or several rows.

For reference, the Data Table component for Screen Flows has existed since Winter '23, designed to display collections of records and allow selecting them, or for a simple display without selection.

Why the Unique Identifier matters

The Unique Identifier is not optional on a whim. Salesforce states that you must configure this field so that rows display and are selected correctly, and to avoid unpredictable behavior when duplicate values appear. It's the same concept as the keyField of the base component lightning-datatable: the unique identifier that ties each row to a record.

Scope and limits

It's worth being clear on one thing before planning your use case: this improvement is for displaying and selecting. The user can see the Apex-Defined collection in the table and, with Row Selection, choose rows to reuse later in the flow. Inline cell editing inside the Data Table is not part of this capability. If your scenario requires the user to edit the data right there, you'll have to solve it with a different approach.

Where you'll use it

Some scenarios where it fits well:

  • Displaying the response of an HTTP callout, such as quotes, stock or data from an external system, without persisting it in Salesforce.

  • Viewing the output of a Transform element or calculations resolved in Apex.

  • Building internal screens for quick review of complex data, without creating objects just to feed the view.

Wrap-up

This is not the flashiest feature of Winter '26, but it removes a concrete friction between the code layer and the interface. For teams that combine Apex with declarative automation, it's one of those improvements that simplify day-to-day work and shrink the transformation code that used to be mandatory.

If you work with Screen Flows and data that originates in Apex, it's worth trying it in a sandbox before the release reaches production.

Official Salesforce sources

Frequently asked questions

What does the Salesforce Winter '26 release bring to Screen Flow Data Tables?

The Winter '26 release lets Screen Flow Data Tables accept Apex-Defined collections as a data source. This means you can now display complex data generated by Apex, such as HTTP call responses, directly, without transforming it into standard object records.

What are Apex-Defined variables and how are they used in Flow?

Apex-Defined variables are complex data structures defined in Apex that Flow can handle. They are created through Apex classes with annotations such as @InvocableMethod and @InvocableVariable, which lets Flow work with custom data types declaratively.

How do you configure an Apex-Defined collection in a Screen Flow Data Table?

First, you add an Apex action to your Screen Flow to run the invocable method that returns the collection. Then, in the Data Table component on the screen, you select that Apex-Defined collection as the Source Collection. Finally, you configure the columns to display and a field as the Unique Identifier.

Why is the Unique Identifier important in the Data Table?

The Unique Identifier is crucial so that rows display and are selected correctly, and to avoid unpredictable behavior with duplicate values. It acts as a unique ID that ties each row to its data, similar to the keyField in lightning-datatable.

Can you edit the cells of a Data Table that displays Apex-Defined collections?

No, this improvement focuses on displaying and selecting data. Inline cell editing in the Data Table is not included with the support for Apex-Defined collections. If you need editing, you will have to implement another solution.

Topics

Juan Manuel Garrido

Written by

Juan Manuel Garrido

Co-founder, Vantegrate

Co-founder of Vantegrate and founder of EGA Futura (1994). He has spent more than 30 years building business software for Latin America and has been a Salesforce partner since 2009. He writes about CRM, business processes and the Salesforce and Oracle ecosystems.

150+ integrations

SalesforceMercado PagoOpenpayPaywayOracleServiceNowSlackSAPStripeFiservSalesforce Marketing CloudMicrosoft Dynamics 365HubSpotWhatsApp BusinessSalesforceMercado PagoOpenpayPaywayOracleServiceNowSlackSAPStripeFiservSalesforce Marketing CloudMicrosoft Dynamics 365HubSpotWhatsApp Business
How many sales slipped away while you read this?

Every minute a WhatsApp message goes unanswered is an opportunity moving to your competitor. Book a demo and find out how much Sellium can sell for your company.

Book a demo

Francisco Morales, co-founder of VantegrateFrancisco Morales, co-founder, takes your call. We reply on WhatsApp within 4 business hours, no strings attached.

Salesforce
ISV Partner
AppExchange Partner
Salesforce · Since 2009
Oracle
OCI Partner
Marketplace & OCI Partner
Oracle Cloud Infrastructure
Share