Hi Jason,
This is my response JSON (with translation map):
{
"translationMap": {
"Name": "$.records.*.Name",
"Phone": "$.records.*.Phone",
"Email": "$.records.*.Email",
"Contact_Locale__c": "$.records.*.Contact_Locale__c",
"Contact_Role__c": "$.records.*.Contact_Role__c",
"Okta_ID__c": "$.records.*.Okta_ID__c",
"Preferred_Language__c": "$.records.*.Preferred_Language__c",
"Id": "$.records.*.Id",
"AccountId": "$.records.*.AccountId",
"AccountName": "$.records.*.Account.Name",
"AccountGMS_Dealer_Customer__c": "$.records.*.Account.GMS_Dealer_Customer__c",
"AccountAccountNumber": "$.records.*.Account.AccountNumber",
"AccountPayment_Method__c": "$.records.*.Account.Payment_Method__c",
"AccountSupply_order_instructions__c": "$.records.*.Account.Supply_order_instructions__c",
"Phone_Extension__c": "$.records.*.Phone_Extension__c",
"ContactAndCompanyName": "$.*.concat($.records.*.Name,\" - \",$.records.*.Account.Name)",
"ContactCount": "$.records.size()"
},
"translationMapDefaults": {
"Contact_Locale__c": "[\"\"]",
"ContactCount": "1"
},
"successTemplate": " #set ( $quo = $esc.quote ) #set($newNull = \"${quo}EMPTY${quo}\" ) {\r\n \"Name\": ${Name},\"Phone\": ${Phone} , \"Email\": ${Email} , \"Contact_Locale__c\": ${Contact_Locale__c.replace(\"null\", $newNull)}, \"Contact_Role__c\": ${Contact_Role__c} , \"Okta_ID__c\": ${Okta_ID__c.replace(\"null\", $newNull)} , \"Preferred_Language__c\": ${Preferred_Language__c} , \"Id\": ${Id} , \"AccountId\": ${AccountId} , \"AccountName\": ${AccountName} , \"AccountGMS_Dealer_Customer__c\": ${AccountGMS_Dealer_Customer__c} , \"AccountAccountNumber\": ${AccountAccountNumber} ,\"AccountPayment_Method__c\": ${AccountPayment_Method__c} ,\"AccountSupply_order_instructions__c\": ${AccountSupply_order_instructions__c} ,\"Phone_Extension__c\": ${Phone_Extension__c},\"ContactAndCompanyName\": ${ContactAndCompanyName} ,\"ContactCount\": ${ContactCount}}"
}
Here is the raw response from the API:
{
"totalSize": 1,
"done": true,
"records": [
{
"attributes": {
"type": "Contact",
"url": "/services/data/v44.0/sobjects/Contact/003D60000"
},
"Id": "003D60000",
"AccountId": "001D600001k",
"Account": {
"attributes": {
"type": "Account",
"url": "/services/data/v44.0/sobjects/Account/001D600001k"
},
"Name": "XXXXXXX EQUIPMENT",
"GMS_Dealer_Customer__c": true,
"AccountNumber": "0018XXXXX",
"Payment_Method__c": "G-Purchase Power",
"Supply_order_instructions__c": "Test SOI"
},
"Name": "James Dunn",
"Phone": "1XXXXXXX",
"Phone_Extension__c": "1234",
"Email": "james.dunn@xxxxxxx.com",
"Contact_Locale__c": "en_US",
"Contact_Role__c": "End User",
"Okta_ID__c": "xxxxxxxxxxxxxxxxxxxx",
"Preferred_Language__c": "English"
}
]
}
And then here is the response after going through translation. We were adjusting the contract to try and get the concatenated field into an array, and now it seems to give the "ContactAndCompanyName" three times, I'm not certain why it does it three times though. All the fields are in an array now at least.
{
"Name": [
"James Dunn"
],
"Phone": [
"1XXXXXXX"
],
"Email": [
"james.dunn@XXXXXXX.com"
],
"Contact_Locale__c": [
"en_US"
],
"Contact_Role__c": [
"End User"
],
"Okta_ID__c": [
"xxxxxxxxxxxxxxxxxxxx"
],
"Preferred_Language__c": [
"English"
],
"Id": [
"003D60000"
],
"AccountId": [
"001D600001k"
],
"AccountName": [
"XXXXXX EQUIPMENT"
],
"AccountGMS_Dealer_Customer__c": [
true
],
"AccountAccountNumber": [
"00184XXXXX"
],
"AccountPayment_Method__c": [
"G-Purchase Power"
],
"AccountSupply_order_instructions__c": [
"Test SOI"
],
"Phone_Extension__c": [
"1234"
],
"ContactAndCompanyName": [
"James Dunn - XXXXX EQUIPMENT",
"James Dunn - XXXXX EQUIPMENT",
"James Dunn - XXXXX EQUIPMENT"
],
"ContactCount": 1
}
If I generate a response where there are multiple contacts & companies returned, it's even stranger:
Raw response:
{
"totalSize": 2,
"done": true,
"records": [
{
"attributes": {
"type": "Contact",
"url": "/services/data/v44.0/sobjects/Contact/003D600001"
},
"Id": "003D600001",
"AccountId": "001D600001",
"Account": {
"attributes": {
"type": "Account",
"url": "/services/data/v44.0/sobjects/Account/001D600001k"
},
"Name": "XXXXXX EQUIPMENT",
"GMS_Dealer_Customer__c": true,
"AccountNumber": "001xxxxxxx",
"Payment_Method__c": "G-Purchase Power",
"Supply_order_instructions__c": "Test SOI"
},
"Name": "First Name",
"Phone": "1234567890",
"Phone_Extension__c": "1234",
"Email": "XXXXYZ@test.com",
"Contact_Locale__c": "da_DK",
"Contact_Role__c": "Economic Buyer",
"Okta_ID__c": "12456",
"Preferred_Language__c": "English"
},
{
"attributes": {
"type": "Contact",
"url": "/services/data/v44.0/sobjects/Contact/003D60000X"
},
"Id": "003D600001J",
"AccountId": "001D600001j",
"Account": {
"attributes": {
"type": "Account",
"url": "/services/data/v44.0/sobjects/Account/001D60002"
},
"Name": "XXXXXXX Print Shop",
"PO_Required__c": "Y",
"GMS_Dealer_Customer__c": false,
"AccountNumber": "0018119752",
"Payment_Method__c": "C-Check"
},
"Name": "XXXXX",
"Phone": "920XXXXX",
"Phone_Extension__c": "1234",
"Email": "c@test.com",
"Contact_Locale__c": "da_DK",
"Contact_Role__c": "Decision Influencer",
"Okta_ID__c": "12",
"Preferred_Language__c": "English"
}
]
}
And response after translation; you can see the concatenated field is merging the Contact & Account name values from both contacts that are returned:
{
"Name": [
"Full Name 1",
"Full Name 2"
],
"Phone": [
"1234567890",
"9xxxxxxxx"
],
"Email": [
"xxxxx@test.com",
"xxxx@test.com"
],
"Contact_Locale__c": [
"da_DK",
"da_DK"
],
"Contact_Role__c": [
"Economic Buyer",
"Decision Influencer"
],
"Okta_ID__c": [
"12456",
"12"
],
"Preferred_Language__c": [
"English",
"English"
],
"Id": [
"003D600001",
"003D600001J"
],
"AccountId": [
"001D600001",
"001D60002"
],
"AccountName": [
"XXXXXX EQUIPMENT",
"XXXXXX Print Shop"
],
"AccountGMS_Dealer_Customer__c": [
true,
false
],
"AccountAccountNumber": [
"00184XXXX",
"00181XXXX"
],
"AccountPayment_Method__c": [
"G-Purchase Power",
"C-Check"
],
"AccountSupply_order_instructions__c": [
"Test SOI",
"EMPTY"
],
"Phone_Extension__c": [
"1234",
"1234"
],
"ContactAndCompanyName": [
"FullName1FullName2 - XXXXX EQUIPMENTXXXXX Print Shop",
"FullName1FullName2 - XXXXX EQUIPMENTXXXXX Print Shop",
"FullName1FullName2 - XXXXX EQUIPMENTXXXXX Print Shop",
],
"ContactCount": 2
}
Sorry, this is a really long reply; I really appreciate any help anyone can give. Thank you.