0

I am trying to figure out why I keep getting an error with my Ampscript code block? I'm new to Ampscript, so apologize for a newbie question, but can someone please take a look at this and see if I set up the statement correctly?

I am trying to create a dynamic header block that looks at my DE that's titled 'Location_Test_De", and checks to see if there is a specific location such as, "Ohana" then the corresponding "PropertyLogo" should populate. But, there's nothing that shows in the email header? I would really appreciate any help here, I've been reading through help documents and I can't seem to figure out what I'm doing wrong, I think it's the setup it self. Thank you.

%%[
VAR @proplocation, @proplogo

SET @proplocation = lookup("Location_Test_DE", "PropertyName","PropertyLogo")

IF @proplocation == 'Ohana' THEN
SET @proplogo = 'https://image.s13.sfmc-content.com/lib/fe3511747364047d731673/m/1/e2eb126c-b7c3-403f-82df-35bcb78b442c.jpeg'

ELSEIF @proplocation == 'Laughlin_Family_Housing' THEN
SET @proplogo = 'https://image.s13.sfmc-content.com/lib/fe3511747364047d731673/m/1/4a7ef3f1-98a2-41b2-bab2-bc42f1c6e82b.jpeg'

ELSEIF @proplocation == 'Corporate' THEN
SET @proplogo = 'https://image.s13.sfmc-content.com/lib/fe3511747364047d731673/m/1/9941a9eb-459c-457f-aa1d-e0acc42a936c.png'


ENDIF
]%%

1 Answer 1

0

Your lookup function is missing an argument. You can read this reference to know how to use it.

I don't know your DE construct, so I guess you can change something like this:

SET @PropertyName =  AttributeValue("Your_property_name_column")
SET @proplocation = lookup("Location_Test_DE", "Your_Property_Location_column_name","PropertyName", @PropertyName)

Final Script:

%%[ 
VAR @proplocation, @proplogo

SET @PropertyName =  AttributeValue("Your_property_name_column")

SET @proplocation = lookup("Location_Test_DE", "Your_Property_Location_column_name","PropertyName", @PropertyName)

IF @proplocation == 'Ohana' THEN 

  SET @proplogo = 'your image 1.jpeg'

ELSEIF @proplocation == 'Laughlin_Family_Housing' THEN 

  SET @proplogo = 'your image 2.jpeg'

ELSEIF @proplocation == 'Corporate' THEN 

  SET @proplogo = 'your image 3.jpeg'

ELSE

  SET @proplogo = 'your fallback image.jpeg'

ENDIF ]%%
1

You must log in to answer this question.

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