This blog will tell you how one can fetch Salesforce data from the Sales cloud into the marketing cloud and then use the automation studio to create an automation process and then shoot an email to the Salesforce data which we have saved into the Data extension in the marketing cloud.
We want to retrieve all the accounts and their related contacts into the Marketing cloud and then segregate accounts data into one data extension and contact data into another data extension.
We have a few accounts created with names starting from Algo and each account has its related contacts available in the Sales cloud.
To achieve the above scenario, we will commence as given below:
1. First, we will create a report in the Sales cloud with report type account and contacts. We can show all the accounts and their contacts if we want or we can apply filters to the report in order to reduce our results.
Don't forget to check out: Salesforce Email Studio – Top compelling reasons why you need it
2. Now in the Marketing cloud under Email Studio > Interactions > Import. We will create an import definition here by using the above report. This will import all the data present in the report into the Marketing Cloud.
After selecting the file location as ‘Salesforce objects and reports’, we just need to provide the name of the report and then select the columns which we want in our Data Extension in Marketing Cloud along with selecting the primary key for the data extension as well. This import will automatically create a data extension with the name matching with the import name.
3. Now we will navigate to the automation studio and we will create SQL queries to segregate the account and contact data into two different data extensions. We must create two different data extensions before creating SQL activity in the automation studio.
SQL activity will segregate the data from the master data extensions and store them in different target data extensions which we will define in the query.
Query used to fetch account records with name starting from Algo: Select [Contact ID], [Account Name], [Account Email] from AlgoAccountsWithContacts where [Account Name] Like 'Algo%'
Query used to fetch related contacts records with their Account name starting from Algo: Select [Contact ID], Salutation, [First Name], [Last Name], Email, [Account Name] from AlgoAccountsWithContacts where [Account Name] Like 'Algo%'
4. Now we need to create email templates to send email to our contacts and accounts. We can create templates in the Content Builder. After creating the templates we will create send email activity and configure them by using the templates which we created and also we will define the target audience in send email activity.
5. As of now, we have created all the activities which we are going to use in our automation. Now we will configure the automation as below:
(i) Imports: Will configure the import activity which will import all the data from Salesforce sales cloud to the marketing cloud.
(ii) Next, configure SQL queries which will retrieve the data from the master data extension and move it into the target data extensions
(iii) In the final step, we will use Send email activity which is going to send the email template to the target audience defined.
(iv) We can schedule the automation as per the different frequencies available.
Check out another amazing blog by Udit here: Key Features of Salesforce Marketing Cloud Connect
The complete structure of the automation should be like the below image:
You can schedule your automation or also can run it once as per your choice.