# Setup Platform Events and Flows

To set up an Order Event flow, it will depend on whether you use [Limio for Salesforce](https://docs.limio.com/integrations/salesforce-integrations/managed-package-overview), an add-on for order management in Salesforce, or not.

Limio for Salesforce comes with a pre-made **Salesforce Lightning Flow** to map your **Salesforce Platform Events** to your Salesforce data. Otherwise, with a few extra steps, you can create a Lightning Flow from scratch.

If you are not familiar with Salesforce Platform Events and Salesforce Lightning Flow, we recommend you do the following:

* [Platform Events Basics](https://trailhead.salesforce.com/content/learn/modules/platform_events_basics)
* [Flow Builder Basics](https://trailhead.salesforce.com/content/learn/modules/flow-basics)

Below you'll find a step-by-step guide for both methods.

* [If you have the Limio for Salesforce managed package installed](https://docs.limio.com/integrations/populating-salesforce-data/platform-events-flexible/setup-platform-events#if-you-have-the-limio-for-salesforce-managed-package-installed)
* [If you don't have Limio for Salesforce](https://docs.limio.com/integrations/populating-salesforce-data/platform-events-flexible/setup-platform-events#if-you-dont-have-limio-for-salesforce)

## **If you have the Limio for Salesforce managed package installed:**

1. **Access the Setup Menu**
   * Go to **Setup** in Salesforce.
2. **Navigate to Flows**
   * In the Quick Find search bar, type **"Flows"** and select the **Flows** page from the search results.
3. **Locate the Flow**
   * Find the flow named **Listen to Limio OrderEvent\_\_e**.

     <figure><img src="/files/XtAxhQIEKZY96b0x73os" alt=""><figcaption></figcaption></figure>
4. **Review the Transform Element**

* Within the **Listen to Limio OrderEvent\_\_e** flow, you will find a transform element named **Map values from event to Object record**.

  <figure><img src="/files/FfhjY9RUfRSvHWnNqj8s" alt=""><figcaption></figcaption></figure>
* Open this transform element to review its configuration:

  * **Source Data**: Set to **i42as\_\_OrderEvent\_\_e**, with a list of its fields displayed.
  * **Target Data**: Set to the **Asset** SObject (or any other object like Opportunity), also showing a list of its fields.

    <figure><img src="/files/LFp9CTrRNkcMNNJKstQi" alt=""><figcaption></figcaption></figure>
  * If you click on a field in the **Source Data**, you can map it directly to the corresponding field in the **Target Data** (Asset SObject).

    <figure><img src="/files/GV82GkKOjNKjeCQ67JjT" alt=""><figcaption></figcaption></figure>

  5\. **Activate the Flow**

  * By default, this flow is inactive.

    <figure><img src="/files/deoXx9ark9tcDb2rEEIn" alt=""><figcaption></figcaption></figure>
* To activate the flow after you configured the target object and fields mapping, click **Activate** in the top-right corner of the screen.

<figure><img src="/files/7k9PocOlEurKcG6xtBhc" alt=""><figcaption></figcaption></figure>

## **If you don't have Limio for Salesforce:**

If you don’t use **Limio for Salesforce**, you can still set up a Platform Event-Triggered Flow to process events and create records in Salesforce. This requires creating your own custom Platform Event and configuring the flow to handle the data accordingly. Additionally, you’ll need to coordinate with Limio to ensure system publishes events to your Salesforce org.

Follow these general steps to implement the solution:

1. Create a Platform Event in Salesforce
2. Create a Platform Event-Triggered Flow
3. Reach Out to Limio Support

**Steps to create Platform Event in Salesforce:**

1. **Access the Setup Menu**
   * Go to **Setup** in Salesforce.
2. **Navigate to Platform Events**
   * In the **Quick Find** search bar, type **"Platform Events"** and select the **Platform Events** page from the search results.
3. **Create a New Platform Event**
   * Click the **New Platform Event** button.
   * Fill in the standard fields.
   * Click **Save** to create the Platform Event.

     <figure><img src="/files/gFKAWHJTBqWSEJXmgJIM" alt=""><figcaption></figcaption></figure>
4. **Add Custom Fields to the Platform Event**

* After saving, you’ll be redirected to the Platform Event’s detail page.
* Click **New Field** to add custom fields to the Platform Event.
  * Choose the field type (e.g., Text, Number, Email, etc.).
  * Define the **Field Label**, **Field Name**, and any necessary field attributes (e.g., length, required status).
  * Click **Save** after creating each custom field.

    <figure><img src="/files/QwjMBeJJki18xVqXfm6S" alt=""><figcaption></figcaption></figure>

Steps to create a Platform Event-Triggered Flow from scratch:

1. **Access the Setup Menu**
   * Go to **Setup** in Salesforce.
2. **Navigate to Flows**
   * In the Quick Find search bar, type **"Flows"** and select the **Flows** page from the search results.
3. **Create a New Flow**
   * Click the **New Flow** button in the top-right corner of the Flows page.

     <figure><img src="/files/2BN6aEQaI774ZXr9lz6n" alt=""><figcaption></figcaption></figure>
4. **Select the Flow Type**
   * In the Flow Type selection screen, choose **Platform Event-Triggered Flow** and click **Create**.

     <figure><img src="/files/NVVSSwFSmONS14kgOzs2" alt=""><figcaption></figcaption></figure>
5. **Choose the Platform Event**
   * In the **Start** element:\
     a. Click **Edit** (pencil icon) next to the **Platform Event** option.\
     b. Select the desired **Platform Event** (e.g., **Express\_Event\_\_e** created above or any custom Platform Event available in your org).\
     c. Click **Done**.

     <figure><img src="/files/1EDHVgcl2f2wucwE5lcC" alt=""><figcaption></figcaption></figure>
6. **Add a Transform Element**
   * Configure the transform element as follows:\
     a. **Source Data**: Select the **Platform Event** fields.\
     b. **Target Data**: Select **Data Type > Record and** **Object** > **Account (or any other target object like Opportunity)**.\ <img src="/files/BTw5aCmVFsbqqUKZq0g4" alt="" data-size="original">\
     c. Map the fields from the **Platform Event** to the corresponding fields in the object. For example:
     * **Platform Event Field (e.g., Name)** → **Account Field (e.g., Name)**
     * **Platform Event Field (e.g., Email)** → **Account Field (e.g., Email\_\_c)**

       <figure><img src="/files/1KBzlDcQcm9vWPcKXyHZ" alt=""><figcaption></figcaption></figure>
7. **Add a Create Records Element**
   * Add the **Create Records** element to the canvas.
   * Configure the element as follows:\
     a. **Label**: Give the element a name (e.g., **Create Account Record**).\
     b. **Record**: Select the **Account** object.\
     c. **Create a Record from These Values**: Use the values mapped from the Platform Event in the transform step.

     <figure><img src="/files/iNp25LFM80EX19XoRUkk" alt=""><figcaption></figcaption></figure>
8. **Save the Flow**
   * Click **Save** and provide a name for your flow.\
     ![](/files/t8J8wM00XlDSJiHo1eIO)\
     ![](/files/yRT7ICwn5Zis6ZZND2dg)
9. **Activate the Flow**

* Once saved, click **Activate** in the top-right corner of the screen to make the flow active and ready to handle incoming platform events.

  <figure><img src="/files/GJX3KwuLAFBZ4xpjF84g" alt=""><figcaption></figcaption></figure>

**Related articles:**

* [What Is a Platform Event-Triggered Flow](https://admin.salesforce.com/blog/2023/what-is-a-platform-event-triggered-flow)


---

# 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.limio.com/integrations/populating-salesforce-data/platform-events-flexible/setup-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.
