I am trying to fetch content from one DE(Let's say A) and send it to another DE(Let's say B), where there is no common field between these Data extensions. I used this code below to fetch the data but it just didn't pull anything.
Here is the code below,
%%[
var @p1, @p2, @p3, @p4, @p5, @today
SET @today = Format(Now(), "M/dd/yy")
SET @rows = LookupRows("TestProducts", "Date", @today)
IF RowCount(@rows) > 0 THEN<
SET @row = Row(@rows,1)
SET @p1 = Field(@row,"Products")
SET @p2 = Field(@row,"Title")
SET @p3 = Field(@row,"Image")
SET @p4 = Field(@row,"Link")
SET @p5 = Field(@row,"Price")
ENDIF
]%%
%%=v(@p1)=%%
%%=v(@p2)=%%
%%=v(@p3)=%%
%%=v(@p4)=%%
%%=v(@p5)=%%
I have few doubts regarding this issue,
If I wanted to send an email to a Data extension A and pull content from a Data extension B, should this both DE's needs to be linked or synchronized to each other? (I saw this somewhere that both DE's needs to be synchronized)
I don't have any common field between these two DE's but I would like to pull content using the lookup, is this a right approach?
Small information about the above code:
Date
is the field I added in my Data Extension ("TestProducts") with the data type date and with the current date being populated. And @today
is a variable where we pull today's date using a function & assign to it.
But I was thinking that the content was not pulled in because the value in Date
& @today
didn't match.
Because in the DE the 'Date' field has time included in it. but in @today
we only get the month, date & year Format(Now(), "M/dd/yy")
So do you think this could be the reason why it's not pulling any content?