I have a contact and account coming to MC from Sales cloud. I want to establish the relationship between these two so that I can access the account Id in the journey builder using the contact and use it to update the Account in the sales cloud. But, I am not knowing on how to establish the relationship between the objects of sales cloud in the MC. Can anyone please help?
1 Answer
Synchronised Data Extensions are a copy of your CRM data and schema is not editable. You don't need to manually setup relationship between those synchronised data extensions. To use those data extensions, normally you will do below steps
- Create a Data Extension to include the fields from Accounts and Contacts
- Create an automation in Automation Studio and include a query activity to join Account and Contact data
- Either run the automation once or schedule it to run to export the query result into the data extension, either insert(new records only),update (upsert), overwrite (overwrite the entire rows in data extension)
Example of query for #2, you need to have those fields in your data extension
SELECT c.ID, c.firstname, c.lastname, c.email, a.ID as 'AccountID', a.Name as 'AccountName'
from Contact_Salesforce c inner join Account_Salesforce a
on c.AccountID = a.ID
Later when you need to update Salesforce record. e.g. in SFMC cloud pages, you will need to use UpdateSingleSalesforceObject Ampscript function and provide the CRM object ID (either ContactID or AccountID depend on which object you want to update)