How to migrate Data from AWS S3 to Salesforce using AWS APPflow (Part 3)

swagataray Avatar

Before writing this blog, I discussed about two options by which you can migrate data from Salesforce to AWS S3. You can find those here

  1. How to migrate Data from Salesforce to AWS S3 using CDC and AWS APPflow – Tech Talk (swagataray.com)
  2. How to Connect AWS S3 with Salesforce using Amazon AppFlow (Part 1) – Tech Talk (swagataray.com)

In this blog I am going to discuss about data migration strategy from AWS S3 to Salesforce. By using this method and other two methods discussed above, you can have two-way data flow between Salesforce and Amazon S3 using AppFlow.

My use case for this blog, to update Salesforce Lead information from AWS S3 to Salesforce. Let’s jump into the process.

Step 1

Create a CSV file with Lead data to update. As you can see in the below picture, column headers are the Lead field names. They no need to be exact but someway relatable that you need at the latter section of the AWS Appflow. After creating the csv file, create a bucket in the AWS S3 from AWS console. Then create a folder under the bucket.

In my case, the bucket name is awstosfdcmigration and folder name Lead Info. Upload your csv file in the folder.

Bucket

Folder and file under folder

Step 2

Go to Amazon Appflow and click on Create flow and provide meaningful name and description.

Step 3

Proceed to the next step and select Amazon S3 as a Source Name. Also provide the bucket details by choosing appropriate S3 bucket name and bucket prefix.

Here I choose, bucket name as awstosfdcmigration and bucket prefix as Lead Info (folder name). Select destination as Salesforce and use the already built Salesforce connection. After that select the object name to which you want to migrate data. In my case that is Lead. Following to this you need to select the Error Handling scenarios and Flow trigger option. These two options based on the use cases which you want to pursue.

Step 4

In this step, you are going to map the csv columns which you have uploaded on the S3 with the Salesforce Lead object. Furthermore, you also need to map the column name which will identify the unique record in the salesforce.

Here are my parameters and mappings.

Destination record preference

Update existing record

Updated field

This mapping will decide which record to update.

RecordId -> Lead Id

Source to destination field mapping

Mapped the remaining CSV file column to the Salesforce Lead fields

Step 5

Go to the next steps and save the flow and it’s done!

Result

Now this is the time to check if everything went well according to plan or not. In the first step, record Id was mentioned.  Take that record Id and query in the Salesforce, something like below picture. This will help you to understand the changes.

Go back to the APPflow and run the flow and a prompt will be popped out and show success message.

Now rerun the query in Salesforce and see the change. Now, you are equipped with Amazon Appflow which can migrate data both ways.

swagataray Avatar

Leave a Reply

Discover more from Tech Talk

Subscribe now to keep reading and get access to the full archive.

Continue reading