DataWeave with Flow Reference Lookup
home
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, determines 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 DataSense and DataMapper to map and transform data, thereby facilitating quick integration with this Software as a Service (SaaS) provider.
Example
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 Anypoint 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
- 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.
Now click 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
In Step 4, check the Account Layout box, then click Save.
- Your new field name appears followed by a double-underscore and a lowercase "c": Region__c. This is the new field to which DataMapper maps the region data it acquires from another flow.