1

I need to populate an HREF by looking up a value in a data extension. Here's what I'm using as the email AMPscript to generate the HREF URL:

%%[ 
 Var @LINK_VALUE, @EMAIL_ADDRESS, @BASE, @LINK_VALUE_1 
 Set @EMAIL_ADDRESS = EMAIL_ADDRESS
 Set @BASE = 'http://'
 Set @LINK_VALUE = Lookup('TABLE_1','LINK_URL','EMAIL_ADDRESS',@EMAIL_ADDRESS)
 Set @LINK_VALUE_1 = concat(@BASE, @LINK_VALUE)
]%%

This script returns http:// and nothing else. I've verified the records I'm previewing against do have a value in LINK_URL of TABLE_1 so am unsure of why this is happening.

2
  • Could you please post your TABLE_1 structure? Commented Feb 28, 2019 at 0:23
  • What error you getting ?
    – Ravi.A
    Commented Mar 1, 2019 at 5:42

2 Answers 2

2

Instead of...

Set @EMAIL_ADDRESS = EMAIL_ADDRESS

Try using a personalization string instead...

Set @EMAIL_ADDRESS = emailaddr

And verify that the email address you're generating a preview against exists in both the test reference (e.g., sendable DE) and the "TABLE_1" DE.

0

Ended up using something a little different that ended up working for my scenario. Adam's would have worked as well.

%%[ 
set @Return_Email_Address = Return_Email_Address
set @BASE =  Lookup(’TABLE_1’,'LINK_URL','Email_Address',@Return_Email_Address
)
set @LINK_VALUE_STEP_1 = 'http://%%=v(@BASE)=%%'
set @LINK_VALUE_STEP_2 = concat(@LINK_VALUE_STEP_1,'/sub-page')

]%%

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .