I need to personalize a triggered send using Marketing Cloud Connect and a custom object to contact relationship, but I'm not getting results for the relationship. My AMPscript looks like this:
%[ Set @mySObject = AttributeValue("SObject") Set @myRecordId = AttributeValue("RecordId") Set @customObject = RetrieveSalesforceObjects(@mySObject,"Field__c, Contact__r.Name","Id", "=",@myRecordId) var @customObjectRow, @fieldValue, @contactName Set @customObjectRow = Row(@customObject, 1) Set @fieldValue = FIELD(@customObjectRow, "Field__c") Set @contactName = FIELD(@customObjectRow, "Contact__r.Name") ]% <html> This will have a value: %%=v(@fieldValue)=%% This will have a blank value: %%=v(@contactName)=%% </html>
I've been reading documentation all night and haven't found anything useful. Can you use object relationships straight from Sales Cloud without having to do another
RetrieveSalesforceObjects function call?