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.
So I've used AMPscript in the email which Ive added to the journey. With this code in place, it always goes into the else loop and return the 'Fallbackvalue' instead of the COntact Owner name.
I tried adding in a delay of an hour and also tried using an old contact that had its retention owner a few days ago. In the preview and test for the email if I choose that contact the values populate correctly. What do you think could be causing the issue?
Code for the amp script is as follows:
%%[ VAR @rs, @row, @value, @ro set @ro = AttributeValue("Retention_Owner__c") SET @rs = RetrieveSalesforceObjects('User','Id,Name', 'Id', '=', @ro) IF RowCount(@rs) == 1 THEN SET @row = Row(@rs, 1) SET @value = Field(@row, 'Name') ELSE SET @value = 'Fallbackvalue' ENDIF ]%% %%=v(@value)=%%
Has anyone faced any similar issues? If so, what should I do in this instance?