0

I am trying to pull first name of a contact to my email (emailbuilder) through a simple lookup on my shared data extension.

<div style="display:none">
 %%[ 
 var @dataExtension, @returnedField, @whereCol, @whereValue 
 Set @dataExtension = 'ENT.Gaia Contact' 
 Set @returnedField = '[First Name]' 
 Set @whereCol = '[Contact Key]'
 Set @whereValue = OKID 
 Set @fieldValue = Lookup(@dataExtension, @returnedField, @whereCol, @whereValue) 
 ]%%
</div>

%%=v(@returnedfield)=%%

Looking to return a customer "First Name" from shared "Gaia Contact" data extension. Where to lookup the name I am trying to match "OKID" (variable in the emails active sending DE) to "Contact Key"(from the DE "Gaia Contact")

Yes, both the data extension and the objects have a space in them.

At the moment when I go to preview the email I get the following message:enter image description here

It seems that the object is not in the DE, but if I open the DE I can see them both first name and the contact key. Also I confirmed manualy that the OKID have a match on contact key and does have the value for First Name in the mentioned DE(Gaia Contact).

Thanks in advance for any help.

1
  • 1
    Can you try to get rid of the square brackets and see if it helps?
    – zuzannamj
    Jan 18, 2023 at 11:19

1 Answer 1

0

Don't use the square brackets to refer to the field name having space, try to remove them.

I also notice that you are using the wrong variable to get the result. Try this:

<div style="display:none">
 %%[ 
 var @dataExtension, @returnedField, @whereCol, @whereValue 
 Set @dataExtension = 'ENT.Gaia Contact' 
 Set @returnedField = 'First Name' 
 Set @whereCol = 'Contact Key'
 Set @whereValue = AttributeValue('OKID')
 Set @fieldValue = Lookup(@dataExtension, @returnedField, @whereCol, @whereValue) 
 ]%%
</div>

%%=v(@fieldValue)=%%

You must log in to answer this question.

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