[SalesForce] Pulling data into email from multiple data extensions

I am receiving the below errors when trying to test send an email that has personalization strings from two different data extensions that are imported into Marketing Cloud.

The subscriber preview failed to generate. Review the details, correct
all issues, and try again. Personalization error: The personalization
string "" was not found in the following data extension(s). To fix
the problem, please try the following:
– Make sure that there is not a space or typo within the personalization string in your email. For example, check and correct
any spaces between percent signs (%%)
– Verify that the field containing the personalization string value is in all data extensions used.
– Correct the Subject of your email. HTML Version Personalization error: The personalization string "" was not found in the following
data extension(s). To fix the problem, please try the following:
– Make sure that there is not a space or typo within the personalization string in your email. For example, check and correct
any spaces between percent signs (%%)
– Verify that the field containing the personalization string value is in all data extensions used.
– Correct the HTML Body of your email.

Another email's personalization strings are populating just fine, but these attributes are coming from a sales cloud extension.

DE 1 = "Customers" – includes First Name attribute
DE 2 = "Contacts" – includes Referral Code attribute

I have the %%firstname%% in the subject line and %%referralcode%% in the body (to reference each of the errors). I have checked to make sure that there are no spaces in the HTML.

The email audience was created from a filtered data extension via the two DE referenced above, that have a data relationship connected by a "contact ID".

I have been reading that I should try AMPscript when trying to pull in data from two DE, but am really confused on how to get started with that. I have been told that the email can pull data from other DE other than the one I am sending to, but it doesn't seem to be working for me. I attempted also to try using a lookup code, but that failed as well. I am wanting the email to populate each audience member's unique first name and referral code in the email (so i think if i did lookup it would have to include multiple rows..)?

Best Answer

'Personalization strings' can only be leveraged from the sending DE. If you want to use a field from another DE you would need to do a lookup() function. Detailed in the dev docs: 'Lookup Function'

You could use this inline within the email like %%=lookup('Contacts','referralcode','subscriberkey',_subscrberkey)=%%

Related Topic