We have a data action that was originally built to query Salesforce for a single case, by case number. The output contract for that has a case object, and all the properties for that object inside it. this worked fine.
Now we have a requirement to pull relationship fields between Case and Account. I have the query working, and the results return as expected, but I cannot get Genesys success template/transform template to play nice with this. I'm starting to wonder if Genesys just doesn't support response objects for a data action that are not super primitive, un-nested objects. Is my only avenue for this to build a second data action to query Account info based on the Case the original action returns?
This is what I'm trying to use as a transformation map, but the web editor just says the translationMap "case must be a string". I didn't want to spend a bunch of time trying to escape the nested JSON mappings, only to find even that isn't supported, so figured I'd just ask if anyone has done a Salesforce SOQL API call with relationship fields includes, since that's basically all I'm doing. My SOQL/API call is a GET to this endpoint, which does work as exptected and does return the Account fields I'm looking to add on.
/services/data/v37.0/query/?q=$esc.url("SELECT Id, CaseNumber, Status, Priority, Subject, Reason, Product__c, Language_List__c,Partner_Type__c,MSP_Target_Account__c,rvpe__RVAccount__c,SuppliedEmail,Account_Type_Case__c,Product_Tier__c,Type,Sub_Type__c,Description,GH_Customer_ID__c,Internal_Notes__c,AcctName__c, AccountId, Account.Notes_for_Care__c FROM Case WHERE CaseNumber='$salesforce.escReserved(${input.CaseNumber})'")
This is the translationMap, defaults (I have not set these yet), and successTemplate. this is, of course, valid JSON, so the validation that I"m failing on is arbitrary to Genesys, not my syntax.

{
"translationMap": {
"case": {
"Status": "$..Status",
"GH_Customer_ID__c": "$..GH_Customer_ID__c",
"MSP_Target_Account__c": "$..MSP_Target_Account__c",
"AccountId": "$..AccountId",
"Language_List__c": "$..Language_List__c",
"Priority": "$..Priority",
"Partner_Type__c": "$..Partner_Type__c",
"Subject": "$..Subject",
"Reason": "$..Reason",
"rvpe__RVAccount__c": "$..rvpe__RVAccount__c",
"SuppliedEmail": "$..SuppliedEmail",
"Type": "$.records[0].Type",
"Sub_Type__c": "$..Sub_Type__c",
"AcctName__c": "$..AcctName__c",
"CaseNumber": "$..CaseNumber",
"Product__c": "$..Product__c",
"Id": "$.records[0].Id",
"Account_Notes_for_Care__c": "$..Account.Notes_for_Care__c"
}
},
"translationMapDefaults": {},
"successTemplate": "${case}"
}
And the output contract is configured as such, with all fields being children of that singular `case` object.

I'm pretty sure I could get around this by changing the output contract to not be an object with nested properties, but that would require updating a TON of references to anything that would use this new version of the data action. That level of effort cannot be under-stated.
#DataActions------------------------------
Paul McGurn
Senior Manager, Telecom & DevOps
Persistent Systems
------------------------------