0

I have email content that lives inside a data extension. It populates the content based on a lookup, daymarker and language code concatenation.

This works but occasionally there might be a new language being added to the sending list/DE, but content for that language won't exist in the content data extension. In this case, if the language does not exist, I would like to set that to to "en"

how do I do that with the lookup?

The day marker will always exist. it follows day of the year (1 - 365)

This is my current script

Var @daymarker, @language, @firstname, @row, @rows, @ldaymarker, @llanguage, @daylang, @rowcount


Set @ldaymarker = AttributeValue("daymarker")
Set @llanguage = AttributeValue("language")
Set @rows = LookupRows("contentde", "daymarker",@ldaymarker,"language",@llanguage)
Set @rowCount = rowcount(@rows) if @rowCount > 0 then
Set @row = row(@rows,1)
Set @daymarker = field(@row,"daymarker")
Set @language = field(@row,"language")
Set @SubjectLine = field(@row,"Subject")
Set @MainImage = field(@row,"Image")
Set @Button = field(@row,"Button")
set @MainText = field(@row,"Text")
set @HeaderText = field(@row,"Header")

else No rows found


endif
``

1 Answer 1

2

You can add it inside a conditional statement - if it doesn’t find any rows for the language passed in the attribute, overwrite the language with “en”:

Set @ldaymarker = AttributeValue("daymarker")
Set @llanguage = AttributeValue("language")
Set @rows = LookupRows("contentde", "daymarker",@ldaymarker,"language",@llanguage)
Set @rowCount = rowcount(@rows) 

if @rowCount > 0 then
Set @row = row(@rows,1)
Set @daymarker = field(@row,"daymarker")
Set @language = field(@row,"language")
Set @SubjectLine = field(@row,"Subject")
Set @MainImage = field(@row,"Image")
Set @Button = field(@row,"Button")
set @MainText = field(@row,"Text")
set @HeaderText = field(@row,"Header")

else

Set @llanguage = "en"
Set @rows = LookupRows("contentde", "daymarker",@ldaymarker,"language",@llanguage)

Set @row = row(@rows,1)
Set @daymarker = field(@row,"daymarker")
Set @language = field(@row,"language")
Set @SubjectLine = field(@row,"Subject")
Set @MainImage = field(@row,"Image")
Set @Button = field(@row,"Button")
set @MainText = field(@row,"Text")
set @HeaderText = field(@row,"Header")


endif

You must log in to answer this question.

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