Contact Free trial Login

Anypoint Exchange

Home to the complete listing of connectors, templates, examples and APIs.
Discover and use proven assets built by the MuleSoft ecosystem, or add assets to a private
tenant of Anypoint Exchange for collaboration and sharing of internal best practices.

DataWeave with Flow Reference Lookup

DataWeave with Flow Reference Lookup

(0 reviews)

Learn how to append data to a message payload and perceptively connect with Salesforce.


This application uses pre-packaged tools to append data to a message payload and perceptively connect with Salesforce. The example takes a CSV file of new account information, figures out which region each account belongs to, appends region information to the payload, then uploads the new accounts to an active Salesforce user account. It uses Mule DataSense and Anypoint DataMapper to map and transform data, thereby facilitating quick integration with this Software as a Service (SaaS) provider.

Example Use Case

The use case upon which this example is based represents a reasonably common requirement to upload new account information into Salesforce. From a CSV file containing information about new accounts (company name, billing address, etc.), a user wishes to use the addresses of the companies to determine to which sales region they belong, then upload all the account details – including sales region – to Salesforce. This example application performs these actions using one Mule application.

Set Up and Run the Example

Complete the following procedure to create, then run this example in your own instance of Mule Studio. Skip ahead to the next section if you prefer to simply examine this example.

To witness end-to-end functionality, you must have an active Salesforce account into which you don't mind inserting a new custom field for "region" and two sample accounts. After this application automatically uploads these accounts, you can manually delete them, and the custom field, in your Salesforce account.

Create a Custom Field in Salesforce

  1. Log in to your Salesforce account, then navigate to the Setup tab. Now click on Customize -> Accounts -> Fields under the Build section on the left side of the page.
  2. Now click on New under the Account Custom Fields & Relationships section.

    • In Step 1 of the new field process, select Text, then click Next to continue.
    • In Step 2, enter values for your new field as per the table below, then click Next to continue.

        Field Label        Region
        Length            50
        Field Name        Region
  3. In Step 4, check the Account Layout box, then click Save.

  4. Your new field name appears followed by a double-underscore and a lowercase "c": Region__c This is the new field to which DataMapper will map the region data it acquires from another flow.


Read full documentation in GitHub


Log into Anypoint Platform to download this asset


Created by
MuleSoft Organization
Published onJun 22, 2017


VersionRuntime version