With every release, Salesforce is making its hot favourite tool, Flow, more and more powerful. Here we will understand one very useful update from winter’ 26 release. We will see how we can display Apex-defined collection data into Screen Flow Data Table.
The Problem (Before Winter ’26)
You must have used Data table to display data in Tabular format into Screen flow wherein you first need to create collection in flow and then add it as source of data table.
However, it is not always possible to create data collection in flow itself if data we need to display is coming from various objects or if data is large or complex.
We often use Apex actions to fetch complex data — like API responses, formatted lists, or joined data models — wrapped in an Apex-defined class
However,
- We could not directly display this data in a Data Table component in the screen flow.
- We had to transform the Apex-defined collection into a standard SObject or string collection.
- This meant extra loops, variables, and complexity inside the Flow.
The New Feature (Winter ’26)
Now in Screen Flow, We can natively display Apex-defined Collections directly into Data Table component.
This makes our life easy when it comes to displaying complex data in screen flows. Therefore now, We can build/retrieve Data in Apex class and use its output as source collection directly into data table element inside Screen flow.
Let’s understand this with business case scenario
Business Use Case
An Account Executive at SalesforceFox wants a quick way to filter all Opportunities by a minimum Amount — directly from the Salesforce Home page.
He wants to enter a value (say, $50,000) and instantly view all Opportunities with an Amount greater than or equal to that number, without navigating to multiple list views or reports.
To make this interactive and user-friendly, We’ll use a Screen Flow embedded on the Home page.
Step-by-Step implementation
1. Using Get Records vs Apex @InvocableMethod
Well, we can use Get Records element in screen flow to filter Opportunities by Amount. However, using Apex-define Collections gives us more flexibility and it is reusable for other actions as well.
Before Winter ’26, It was not possible to directly use that Apex-defined collections as source of Data Table to display on screen. But now, we can do all complex data processing in Apex class itself and then using @InvocableMethod we can that data collections inside Screen Flow Data Table.
2. Create Apex class with @InvocableMethod
Here, We will create Apex class with @InvocableMethod. This is special decorator to be used in apex method so that we can use this from screen flow actions.
public with sharing class OpportunityWrapper {
@AuraEnabled
public Id opportunityId { get; set; }
@AuraEnabled
public String opportunityName { get; set; }
@AuraEnabled
public String accountName { get; set; }
@AuraEnabled
public String stageName { get; set; }
@AuraEnabled
public Decimal amount { get; set; }
@AuraEnabled
public Date closeDate { get; set; }
@AuraEnabled
public Decimal probability { get; set; }
@AuraEnabled
public String type { get; set; }
@AuraEnabled
public String leadSource { get; set; }
@AuraEnabled
public String ownerName { get; set; }
@AuraEnabled
public Date createdDate { get; set; }
@AuraEnabled
public String forecastCategory { get; set; }
@AuraEnabled
public Boolean isClosed { get; set; }
@AuraEnabled
public Boolean isWon { get; set; }
}public with sharing class OpporuntityInvocableController {
public class FlowInputs {
@InvocableVariable(
label='Minimum Amount'
description='Filter opportunities by minimum amount')
public Decimal minAmount;
}
public class FlowOutputs {
@InvocableVariable(label='Opportunity Details')
public List<OpportunityWrapper> opportunityDetails;
}
@InvocableMethod(
label='Get Opportunity Details'
description='Retrieves opportunity details for display in Screen Flow dataTable'
category='Opportunity')
public static List<FlowOutputs> getOpportunityDetails(List<FlowInputs> inputs) {
FlowInputs input = inputs[0];
Decimal minAmount = input.minAmount;
// Build dynamic query
String query = 'SELECT Id, Name, Account.Name, StageName, Amount, CloseDate, ' +
'Probability, Type, LeadSource, Owner.Name, CreatedDate, ' +
'ForecastCategory, IsClosed, IsWon ' +
'FROM Opportunity WHERE Id != null';
if (input.minAmount != null) {
query += ' AND Amount >= :minAmount';
}
// Execute query
List<Opportunity> opportunities = Database.query(query);
// Transform to wrapper objects
List<OpportunityWrapper> oppWrappers = new List<OpportunityWrapper>();
for (Opportunity opp : opportunities) {
OpportunityWrapper wrapper = new OpportunityWrapper();
wrapper.opportunityId = opp.Id;
wrapper.opportunityName = opp.Name;
wrapper.accountName = opp.Account?.Name;
wrapper.stageName = opp.StageName;
wrapper.amount = opp.Amount;
wrapper.closeDate = opp.CloseDate;
wrapper.probability = opp.Probability;
wrapper.type = opp.Type;
wrapper.leadSource = opp.LeadSource;
wrapper.ownerName = opp.Owner?.Name;
wrapper.createdDate = opp.CreatedDate.date();
wrapper.forecastCategory = opp.ForecastCategory;
wrapper.isClosed = opp.IsClosed;
wrapper.isWon = opp.IsWon;
oppWrappers.add(wrapper);
}
// Prepare output
FlowOutputs output = new FlowOutputs();
output.opportunityDetails = oppWrappers;
return new List<FlowOutputs>{ output };
}
}- Here, we have created one method
getOpportunityDetails()with decorator @InvocableMethod so that we can call this from screen flow actions. - We want to pass input from flow (minimum amount in our case) and want Opportunity details as output so we have created two wrapper class called FlowInputs & FlowOutputs to structure and pass data to and from a Flow
3. Build Screen Flow
i. Adding First Screen for User to enter Opportunity Amount
First of all, we will add screen element and inside the screen add Text element to so that user can enter opportunity’s minimum amount to filter it
ii. Calling Apex Action to get filtered Opportunities
Now, as shown below add Action element and call our apex class we created above which will provide us filtered opportunities

For this Apex class we have defined Input and Output parameters, As shown below, as an input, we will pass minimum amount that user has entered in first screen input and then apex class will return us filtered opportunities which is available as output source of this apex actions

iii. Adding Data Table with apex action data on screen
Now, Let’s add Screen element and add Data Table into it
Once we have apex action defined. now, it’s time to feed its output sources as source to our Data Table element.
As a shown below, we have added Opportunity Details output source from Apex action as a source collection to data table.

Once source collection is selected for Data Table, make sure to configure rows and columns for the same as shown below


iv. How entire Screen Flow looks like

4. Filter Opportunity Screen Flow In Action





