3

When I try to SET a variable using a lookup from the Data Extension that we're deploying to, it doesn't work... when I set the value by placing just the field name it works fine.

SET @Currency = LookUp('MYDEName','currency','emailaddress',emailaddr) FAILS

SET @currency = currency WORKS

What gives? I've never encountered this before

1 Answer 1

3

Why do you need to perform a lookup if your Currency field is on the sendable data extension?

Your syntax is correct. Check that your DE names and field names are correct: MYDEName, currency, emailaddress

Try setting the emailaddr as a variable. Then you can hard-code the value to check that it is working correctly.

%%[
set @emailaddr = emailaddr
SET @Currency = LookUp('MYDEName','currency','emailaddress',@emailaddr)
]%%
4
  • Thanks Jackson - Do I need to the lookup? No, but I like to keep my coding consistent as we are doing several lookups. I'm still unsure why it's not working though. Commented Apr 4, 2019 at 1:41
  • It seems unnecessary to perform a lookup if it's in the sendable data extension. Have you verified that the field names are correct and the email address is in the data extension? Commented Apr 4, 2019 at 2:09
  • 2
    @GeorgeRosedale - doing unnecessary lookups will cause increased processing and is very inefficient and most certainly not best practice. Also, you will be doing a lookup on a DE that is currently being used (in the email send). I feel like it may be failing as that specific row is 'locked' while it is processing the email. Commented Apr 4, 2019 at 12:58
  • 1
    @Gortonington - I have a feeling the db being locked is the culprit here. Commented Apr 5, 2019 at 12:53

You must log in to answer this question.

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