Video tutorials
/
How to Build a Pivot Table in a Salesforce Screen Flow
Screen Flows

How to Build a Pivot Table in a Salesforce Screen Flow

Group open opportunities by stage and customer type, then click a subtotal to see the deals in the same Screen Flow.

Advanced
4:33
Tutorial
How to Build a Pivot Table in a Salesforce Screen Flow
Play video
Chapters
0:00 See the deals behind the number 0:17 Avonni Flow Screen Components 1:12 Build it by hand 2:09 Run the manual flow in Lightning 2:35 Build the same flow with Claude Code 3:26 Compare with standard Salesforce Flow 4:14 Next step
Click a chapter to jump to it
Watch on YouTube

What you will build

Build a clickable Avonni Pivot Table in a Salesforce Screen Flow. Group open opportunities by stage and customer type, sum their amounts, and open the opportunity records behind each total without leaving the review screen.

See the exact Flow Builder settings, then build the same workflow with Claude Code and compare it with a native Screen Flow on the same data.

Prompt used to plan:

Plan a Screen Flow for a weekly pipeline review. Use the Avonni Flow Components skill and MCP. Include open Opportunities only. Rows: Stage. Columns: Opportunity Type. Sum Amount. Enable Detail Rows. Next: Review notes with optional Follow-up notes. Show the plan and wait. Do not edit or deploy.

Follow-up prompt:

Build the plan. Use the skill scaffold and validator. Save Solar_Pipeline_Review_AI.flow-meta.xml as Draft. Show the validator result. Do not deploy.

Two small refinements made before testing:

Refine the draft. On the second screen replace both Avonni text areas with one optional standard Salesforce LongTextArea labeled Follow-up notes. Keep the Pivot Table and the Review notes button. Run the skill validator again. Do not deploy.

Set the first screen nextOrFinishButtonLabel to Review notes. Validate again. Do not deploy.

Transcript

0:00 See the deals behind the number

You’re in a pipeline review. Someone asks, “Which deals make up the fifty thousand dollars in new-customer proposals?” One click, and there they are. You can compare that segment with the rest of the pipeline and go straight into your review notes. I’m Cédric. I’ll show you how to build that screen.

0:17 Avonni Flow Screen Components

Avonni Flow Screen Components adds configurable building blocks to Salesforce Flow Builder. A Pivot Table sits outside Salesforce’s standard Screen Flow component library. With Avonni, we can compare totals by stage and customer type, inspect a cell’s deals, and continue the review in the same flow. Install the Avonni package and open Custom on a flow screen. Here’s the collection, from Data Tables and Kanban boards to maps and calendars. For this review, choose Pivot Table. The Avonni Component Builder configures the screen component. Flow Builder connects the review steps. We’ll build it by hand first. For the second build, Claude Code turns the brief into a first draft of the Flow file. The Avonni skill guides the build, and the MCP supplies the actual component settings. You review the plan and test the result in a scratch org.

1:12 Build it by hand

On your review screen, add the Avonni Pivot Table from the Custom components in Flow Builder. Select the component and click Open Component Builder. This is where you control the source of the records, how they’re grouped, and what happens when someone clicks a number. Under Data Source, use Opportunity and set Closed to false. That keeps the closed deals out of both the totals and the detail. Under Data Mappings, add Stage to Group Rows and Opportunity Type to Group Columns. In Aggregations, choose Amount and set the measure to Sum. Each cell now adds up the open opportunities at that intersection. Turn on Detail Rows. That’s the setting that opens the records behind a cell when the user clicks it. Then connect your review screen to the next screen in the Flow. Here, the next button is called Review notes, and it leads to a notes field for the sales manager.

2:09 Run the manual flow in Lightning

Back in the Solar Sales Workspace, the manager can compare all four segments. Open the New Customer cell for Proposal or Price Quote. Solar East is twenty thousand dollars and Solar Central is thirty thousand. They add up to the fifty thousand in the grid. The closed opportunity stays out of the review. Click Review notes to continue in the same Flow.

2:35 Build the same flow with Claude Code

Here’s the same brief in Claude Code. Give it the job first. Then tell it which records to include, how to group them, and what a click should do. Ask it to read the Avonni skill and look up Pivot Table in the MCP. The two prompts used for this build are in the description. Check the proposed mapping before Claude writes the Flow file. Look for open Opportunities, Stage in rows, Opportunity Type in columns, Sum of Amount, and Detail Rows. The skill validator checks the file. The scratch org is where we check the experience. In the sales workspace, open Pipeline Review AI and click the same fifty-thousand-dollar cell. Solar East and Solar Central appear. Review notes takes us to the next screen.

3:26 Compare with standard Salesforce Flow

Now that we’ve seen the result, let’s run the same review with standard Flow components so you can see what the Pivot Table takes care of. In our native version, pick a stage and customer type, then click Show opportunities. Get Records finds those deals, a loop totals them, and the Data Table shows the matching rows. If you’re doing reporting, Salesforce matrix reports can also open the records behind a total. Here, Avonni takes care of the grouping, the math, and the drill-down in one component. The manager can scan all four totals before picking a segment, then go from the number to the deals in one click. The summary stays in view, and her next step is still right there.

4:14 Next step

Next, watch how to make a Screen Flow Data Table easier to scan using progress bars, badges, and avatars.

Show the full transcript

Questions this video answers

See it as a use case
No items found.
Build it in your org

Free in sandboxes, 10 free production licenses.

Start free
Keep going

Related tutorials

No items found.

Find your next tutorial

Browse the whole library, filtered by where it runs and what you want to build.

All video tutorials