Configuration tutorial

How to Build a Self-Updating Data Table in Salesforce with Platform Events

This step-by-step guide walks you through the process of creating a real-time updating Data Table using Avonni, Platform Events, and Salesforce Flows.

By the end, you'll have a Data Table that automatically refreshes itself—no manual reloads required—whenever related records are created or updated in Salesforce.

Overview of What You'll Build

To make this work, you'll set up three things:

  1. A Platform Event to broadcast data changes

  2. A Record-Triggered Flow to publish the event

  3. A Screen Flow with a Data Table that listens and refreshes in real-time

1

Create a Platform Event

We need a way to signal when a record changes. Platform Events act like a message system, letting us broadcast these changes in real-time

  • Go to Setup and search for Platform Events.

  • Click New Platform Event.

  • Fill in the Label (e.g., "RecordChangeEvent"), Plural Label, and the API Name should auto-populate.

  • Set Publish Behavior to Publish After Commit.

  • Click Save.

2

Add a Field to the Platform Event

We’ll use a field to pass the ID of the changed record. This helps the component know which data to refresh.

  1. Inside your new Platform Event, click New Field.

  2. Choose Text as the data type.

  3. Fill in:

    • Field Label: Example – RecordId

    • The API Field Name will auto-fill.

  4. Click Next, configure any field options if needed, and click Save.

3

Create a Trigger Flow

This Flow sends a Platform Event when a record is created or updated.

  1. In Setup, search for Flows and click New Flow.

  2. Choose Record-Triggered Flow.

  3. Configure the flow trigger:

    • Object: Choose the object to watch (e.g., Lead or Account)

    • Trigger: Choose Created, Updated, or both

    • Add Conditions if you only want the event triggered in specific cases

  4. Click Done.

Now add an action to publish the Platform Event:

  1. Drag a Create Records element to the canvas.

    • Label: e.g., Create Record Change Event

    • How to Set Values: Select Manually

    • Object: Choose the Platform Event you created (e.g., RecordChangeEvent__e)

    • Field Values: Set the RecordId field to {!Record.Id}

  2. (Optional) Add a Decision node if you want more control over when the event is sent.

  3. Click Activate to turn on the flow.

4

Create a Screen Flow

Now we build the actual user interface that listens for the Platform Event and refreshes automatically.

  1. In Setup, go to Flows and click New Flow.

  2. Choose Screen Flow.

  3. Add a Screen element to the canvas.

  4. Drag a Data Table component onto the screen.

Configure the Data Table:

  • Data Source: Select Query

  • Object: Choose the object you want to display (e.g., Account)

Configure Real-Time Refresh:

  • In the Advanced Options of the Data Table:

    • Channel Name: Enter the API name of your Platform Event (e.g., RecordChangeEvent__e)

    • Key Field Name: Enter the name of the Platform Event field that holds the record ID (RecordId)

    • (Optional) Key Field Value: Use this if you only want to refresh for one specific record ID

💡 Want to understand these settings in detail? See: Query Refresh EMP Options Explained

5

Deploy the Flow

Click "Save" and then "Activate" your Screen Flow.

Now you have a datatable that updates in real-time whenever the specified records are changed, thanks to the power of Platform Events and Salesforce Flows.

Last updated

Was this helpful?