# Platform Events

## What Are Platform Events?

Platform Events in Salesforce act like instant messengers within your org. They allow different parts of your system—or even external systems—to notify each other immediately when something changes. This makes your Flows more dynamic and more responsive.

<figure><img src="/files/1WA2b7ukS72xHbLRt3TT" alt=""><figcaption></figcaption></figure>

***

## Why Use Platform Events with Flows?

Let’s say multiple sales reps are working from the same list of leads. When one rep claims a lead, you want that lead to disappear from everyone else’s screen right away to prevent duplication or errors. This is precisely what Platform Events are designed for: keeping every user’s view in sync, in real-time.

***

## Benefits of Platform Events in Flows

* **Live Collaboration**: Everyone using your Flow sees the most current data—instantly.
* **Avoid Data Conflicts**: Changes (like assigning a lead) update across users, preventing multiple people from working on the same record.
* **Smooth, Engaging UX**: With no need for manual refreshes, your users experience faster, more fluid interactions.

***

## Supported Components

Avonni’s following data components are compatible with Platform Events and support live updates:

* [Data Table](/flow/tutorials/components/data-table.md)
* [Kanban](/flow/flow-components/kanban.md)
* [List](/flow/flow-components/list.md)
* [Calendar](/flow/flow-components/calendar.md)
* [Map](/flow/flow-components/map.md)

These components listen to Platform Events and refresh themselves automatically—no custom logic or refresh button needed.

***

## How to Enable Platform Event Integration

Platform Event integration is available when you use a **Query** as the data source in your component.

To enable it:

1. Open the component using a [**Query data source**](/flow/component-builder/data-sources/query.md).
2. Go to the **Advanced Options** section.
3. Look for the **“Query Refresh EMP”** settings.

<figure><img src="/files/AATnxHKk6IYgImFQfRAy" alt="" width="160"><figcaption></figcaption></figure>

## Query Refresh EMP Settings Explained

When configuring a component to refresh using Platform Events automatically, the **Query Refresh EMP** section (available under Advanced Options when using a **Query** data source) allows you to control how and when the data should be updated. There are **three key options** you need to understand:

***

### **1. Channel Name**

**What it is:**\
The name of the **Platform Event object** your component should listen to.

**Why it's important:**\
This is how your component knows which type of real-time message to listen for.\
Example: If your Platform Event is called `RecordChangeEvent__e`, that’s what you enter here.

***

### **2. Key Field Name**

**What it is:**\
The name of a specific field in your Platform Event that acts as a **filter**.

**Why it's important:**\
It allows your component to only react to Platform Event messages **that are relevant to what it's displaying**. Typically, this is something like a `RecordId` field.

**How it works:**\
If this field is left **blank**, the component will refresh **every time** the Platform Event is triggered, regardless of which record it’s about.\
If you **do specify** a key field, the component will only refresh if the value in that field matches a record currently visible in the component.

***

### **3. Key Field Value (Optional)**

**What it is:**\
A specific value to compare against the **Key Field Name**.

**Why it's important:**\
Use this if you only want the component to refresh when a very **specific value** is received in the Platform Event.\
Example: Only refresh the data table if `RecordId = 001XXXXXXXXXXXX`.

> ⚠️ Note: You typically use either **Key Field Name** or **Key Field Value**, not both. If **only the Key Field Name** is set, the component will refresh based on whether any of its visible records match the incoming Platform Event. If you add a **Key Field Value**, it becomes even more precise—refreshing only if the Platform Event matches **that exact value**.

{% content-ref url="/pages/aHhGqfVjsH5MCXIYdTQ6" %}
[Configuration tutorial](/flow/tutorials/platform-events/configuration-tutorial.md)
{% endcontent-ref %}

## **Summary**

Platform Events are the key to building responsive, collaborative, and conflict-free flows. Avonni Data Components seamlessly integrate with Platform Events, allowing you to create Flows that deliver a powerful and user-friendly experience.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.avonnicomponents.com/flow/tutorials/platform-events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
