I'm still new to ampscript, particular when trying to reference a two data extensions for my CloudPage. The use case is we send an email to our customers which contains their email address and a store ID assignment to the record. We want to be able to display the store information to each customer when they visit our landing page, using a content block to house the information.
Within the email I have the following ampscript;
%%[/* AMPScript Email Content initialization <div style="display:none"> */
SET @Debug = false
/*DATA EXTENSIONS*/
SET @Store_Properties = 'Store_Properties'
/*Content fields*/
SET @Store_label = "Store"
SET @Address_label = "Address"
SET @Phone_label = "Phone"
SET @OpeningHours_label = "OpeningHours"
SET @OpeningDays_label = "OpeningDays"
/*ROWS*/
SET @EmailLookUpRow = LookupRows("Store_Properties","Store_label", Store)
SET @EmailRowCountLookUp = rowcount(@EmailLookUpRow)
SET @Row = Row(@EmailLookUpRow,1)
/*Expose values to variables*/
SET @Store = Field(@row, "Store_label")
SET @Address = Field(@row, "Address_label")
SET @Phone = Field(@row, "Phone_label")
SET @OpeningHours = Field(@row, "OpeningHours_label")
SET @OpeningDays = Field(@row, "OpeningDays_label")
ENDIF
/*</div>*/
]%%
This works fine in the content block of the email.
I then have a link to my CloudPage within the email as per http://myURL/%%EmailAddress%%.
I have tried multiple ways of pulling in the information from the send data extension into the CloudPage but haven't been able to generate the correct store information, only the fallback content.
The send data extension is different to Store_Properties. For instance, we send to "recent purchasers".
The logic that I think I need to follow is set the store from the send DE and then reference this when retrieving the store information from my other DE.
Has anyone successfully used two DE's to pull information into a CloudPage?
Thanks in advance. Bevan