I'm just trying to practice a simple Lookup function. I event looked at AMPscript lookup Examples. However I do not understand what is wrong with my AMPscript-code.
I'm getting this error below from SFMC:
Unable to generate preview
Personalization error:
%%program_cd%%
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 (%%)
– Correct the HTML Body of your email.
my code:
%%[
var @offer, @lookupvalue
set @lookupvalue = AttributeValue("BannerURL")
set @offer = Lookup("DE", "Offer", "BannerURL", @lookupvalue)
]%%
%%=v(@offer)=%%
Best Answer
It seems like the error isn't in the AMPscript-code you provided, but rather in the rest of the email, which contains the invalid personalization string
%%program_cd%%
. This could be in any content block, template or even the header/footer configured in your sender profile.Try a plain email without any template and if this doesn't work check your header/footer configuration for further debugging.