Loading
Prepare for Email to Become the Default Login ExperienceRead More
Intermittent freezing when using using certain browser versionsRead More
Automate Your Business Processes with Salesforce Flow
Use Records to Trigger Actions in External Systems Example

Use Records to Trigger Actions in External Systems Example

This example creates a flow that uses a third-party connector to take action in an external system, such as creating a sales order in NetSuite after an order is created or updated in Salesforce.

Required Editions

View supported editions.
This feature requires the MuleSoft for Flow: Integration add-on. Exceptions are segment-triggered flows, activation-triggered flows, and broadcast flows, which don't require the MuleSoft for Flow: Integration add-on. Professional Edition requires the API access add-on. To purchase an add-on, contact your Salesforce account executive.
MuleSoft for Flow: Integration features used with Agentforce require the Foundations or Agentforce 1 edition. To purchase these editions, contact your Salesforce account executive.
Note
Note You can edit or delete connections only in the Automation app.
User Permissions Needed
To create, view, edit, and delete MuleSoft for Flow: Integration connections: Manage Integration Connections
To open, edit, create, activate or deactivate a flow using all flow types, elements, and features available in Flow Builder, including Einstein and Agentforce for Flow: Manage Flow
To create and edit External System Change-Triggered flows in the Automation app, regardless of sharing settings:

Manage Flow

OR

Create or Edit Flows

AND

  • View Flows
  • View All Non-Admin Flows
To create and edit External System Change-Triggered flows owned by or shared with you with Read/Write access in the Automation app:

Create or Edit Flows

AND

View Flows

To use MuleSoft for Flow: Integration templates:

Create or Edit Flows

OR

View Flows

To use MuleSoft for Flow: Integration templates as a non-System Admin: App Framework Manage Template

Create a Flow

  1. In the Automation app, go to the Flows tab and then click New.
  2. Select Record-Triggered Flow.

Configure the Start Element

  1. In Object, select Order.
  2. In Configure Trigger, select A record is created or updated.
  3. In Set Entry Conditions, in Condition Requirements, select Custom Condition Logic is Met.
  4. In Condition Logic, make sure that the value is 1 AND 2.
  5. In the fields, enter:
    Field Operator Value
    Status Equals Draft
    Order Type Is Changed True
  6. In When to Run the Flow for Updated Records, select Only when a record is updated to meet the condition requirements.
  7. In Optimize the Flow for, select Actions and Records. Then, enable the Add Asynchronous Path option. Updating the record requires the user to have the Manage Integration Connections permission.

Add a Get Records Element

Add a Get Records element to return a list of products.

  1. Under Run Asynchronously, click Add element and then select Get Records.
  2. In the Label field, enter Get Order Products. The API Name field populates automatically.
  3. Configure the input values for the Get Records element:
    Field Value
    Object Order Product
    Condition Requirements All Conditions Are Met (AND)
    Field Order ID
    Operator Equals
    Value Triggering Order > Order ID
    Sort Order Not Sorted
    How Many Records to Store All records
    How to Store Record Data Automatically store all fields

Configure the Action

  1. Under Get Records, click Add element and then select Action.
  2. In the Search Actions panel, select Connectors. Select NetSuite, and then select Create Record.
  3. Fill out the required fields for that action.
  4. Create a new connection or use an existing connection.
    A connection test runs.

Set Input Values for the Selected Action

  1. In Set Input Values for the Selected Action, in Record Type, select Sales Order.
  2. In Set Input Values for the Selected Action, in Body, click Select Fields and select these fields:
    • startDate
    • billingAddress > addr1
    • billingAddress > city
    • billingAddress > state
    • entity > externalId
  3. Click Done.
  4. Set the values.
    Field Value
    startDate Triggering Order > Order Start Date
    addr1 Triggering Order > Billing Address
    city Triggering Order > Billing City
    state Triggering Order > Billing State/Province
    externalID Triggering Order > Account ID

Map NetSuite Fields to Salesforce Fields

  1. Switch to Transform View.
  2. In Source Data, click Add element. In the Resource box, select Order Products from the Get_Order_Products Order Item.
  3. Map the fields from Get Order Products.
    Source Data Target Data
    UnitPrice amount
    Description description
    Quantity quantity
    Tip
    Tip

    To make sure that the flow continues after a brief pause, add a Wait for Amount of Time element to your flow after a Create, Update, or Delete action. By selecting 1 Minute in the Amount of Time field, you make sure that the system processes changes before the third-party action proceeds.

  4. Test, debug, save, and activate your flow.
    Now, when you create or update an Order in Salesforce, your flow creates a Sales Order in NetSuite.
 
Loading
Salesforce Help | Article