I have an email in Marketing Cloud in which I want to get the contact owner's name to show up at the bottom in the signature. First I used the Lookup function and when I verify and test the email it works fine, but when I add it to the journey, I get a cancellation triggered send with error:
ExactTarget.OMM.InvalidScriptException: An error occurred when attempting to resolve a function call. See inner exception for detail. Function Call: Lookup('User_Salesforce','Email','Id',Retention_Owner__c)
The second method I tried was using AMPscript. With this, it's the same issue, where the email works in verify and test, and when I validate the journey, I get an error:
Error 1: Script SET Statement Invalid An error occurred when attempting to resolve a script expression. See inner exception for detail. Script Expression: RetrieveSalesforceObjects('User','Id,Name', 'Id', '=', Retention_Owner__c)
The code is below:
For lookup I used: %%=Lookup('User_Salesforce','Email','Id',Retention_Owner__c)=%%
where User_Salesforce is the synchronized DE
and for AMPscript I used:
%%[ VAR @rs, @row, @value SET @rs = RetrieveSalesforceObjects('User','Id,Name', 'Id', '=', Retention_Owner__c) IF RowCount(@rs) == 1 THEN SET @row = Row(@rs, 1) SET @value = Field(@row, 'Name') ELSE SET @value = 'Fallbackvalue' ENDIF ]%% %%=v(@value)=%% Could anyone point out what I doing wrong here?