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.

  • Could you please post your TABLE_1 structure? – thechrishaddad Feb 28 '19 at 0:23
  • What error you getting ? – pkharries Mar 1 '19 at 5:42
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.

| improve this answer | |
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')

]%%
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.