Using SF Composite API
I am trying to use the Composite API option on the SF Connector (to create an account and contacts) but am having trouble with each call creating a new account.
What I want is for each payload to create an account (based on the primary member), and then create contacts based on any dependents. What is happening is that a new account is being created each time with a new dependent added as a contact.
For example, if John Doe is the primary member and Jane Doe is the spouse and Kid Doe is the child, I would expect one account for for John Doe and then 3 contacts linked to that account (John, Jane and Kid Doe). What I am ending up with is:
John Doe Account with John Doe Contact
John Doe Account with Jane Doe Contact
John Doe Account with Kid Doe Contact
I need to somehow reference the primary account (i.e. John Doe) for all contacts being imported to make sure they are tied to that account and not creating new accounts for each contact. Below is a sample payload of that section, along with a couple screenshots from the import. As always, I appreciate the help!
{
"FormInformation": {
"FormName": "[CELIGO TEST] Enrollment",
"SubmitDate": "2024-12-09",
"CognitoFormId": "326-2",
"FormURL": "https://www.test.com",
"Status": "Submitted",
"EnrolledFrom": "Cognito"
},
"AccountInformation": {
"AccountName": "John Doe",
"StreetAddress": "12345 Main Street",
"City": "Miami",
"State": "FL",
"ZipCode": "44556"
},
"ContactInformation": [
{
"FirstName": "John",
"LastName": "Doe",
"MiddleName": "Henry",
"MiddleInitial": "H",
"NamePrefix": "Mr.",
"NameSuffix": null,
"Relationship": "Self",
"DateOfBirth": "1972-01-17",
"Gender": "Male",
"SocialSecurityNumber": "123-45-6789",
"TobaccoUser": "No",
"Email": "johndoe@example.com",
"MobilePhoneNumber": "(123) 456-7890",
"CompanyPhoneNumber": "(098) 765-4321"
},
{
"FirstName": "Jane",
"LastName": "Doe",
"MiddleName": "Elizabeth",
"MiddleInitial": "E",
"NamePrefix": "Mrs.",
"NameSuffix": null,
"Relationship": "Spouse",
"DateOfBirth": "1980-05-15",
"Gender": "Female",
"SocialSecurityNumber": "987-65-4321",
"TobaccoUser": "No"
},
{
"FirstName": "James",
"LastName": "Doe",
"MiddleName": "Michael",
"MiddleInitial": "M",
"Relationship": "Child",
"DateOfBirth": "2009-03-22",
"Gender": "Male",
"SocialSecurityNumber": "111-22-3333",
"TobaccoUser": "No",
"NamePrefix": "Master",
"NameSuffix": null
},
{
"FirstName": "Emily",
"LastName": "Doe",
"MiddleName": "Grace",
"MiddleInitial": "G",
"Relationship": "Child",
"DateOfBirth": "2010-07-12",
"Gender": "Female",
"SocialSecurityNumber": "222-33-4444",
"TobaccoUser": "No",
"NamePrefix": "Miss",
"NameSuffix": null
},
{
"FirstName": "Sophia",
"LastName": "Doe",
"MiddleName": "Rose",
"MiddleInitial": "R",
"Relationship": "Child",
"DateOfBirth": "2017-11-05",
"Gender": "Female",
"SocialSecurityNumber": "333-44-5555",
"TobaccoUser": "No",
"NamePrefix": "Miss",
"NameSuffix": null
},
{
"FirstName": "William",
"LastName": "Doe",
"MiddleName": "Thomas",
"MiddleInitial": "T",
"Relationship": "Child",
"DateOfBirth": "2012-09-07",
"Gender": "Male",
"SocialSecurityNumber": "444-55-6666",
"TobaccoUser": "No",
"NamePrefix": "Master",
"NameSuffix": null
}
],
"PlanInformation": {
"PlanMembers": "Married with Kid/s",
"OldestPlanMember": "John Doe",
"DesiredStartDate": "2024-03-01"
}
}


Comments
Hi Dave Guderian ,
Since you have enabled oneToMany in your import, different account is getting created for each contact. In order to avoid that, keep oneToMany as false and in the mappings, map the contact fields with
ContactInformation[*].<<your_field>>
. For ex-Contacts : First name
withContactInformation[*].FirstName
.That way you will have one account created and all the contacts in your array will be attached to it.
Hope it helps!
That worked! Thank you so much for the help Anagha!
Please sign in to leave a comment.