0

How to pull data from a specific data extension that can be displayed on a Landing Page using Ampscript?

On the email I have this Ampscript which displays the Balance Points once sent on the Email Subscriber:

%%[                                                             
VAR @balance                                                                
SET @balance = Lookup("Cebu-GetGo-MemberBalance-DE", "Balance", "Account_No", [Account_No])                                                                 
IF  empty(@balance) THEN                                                                
SET @balance = "0"                                                                  
ENDIF
]%%
Points Balance: %%=v(@balance)=%% points

From the Email I want to pull the Points Balance to Landing page I've created, once the subscriber click on the link Check Balance from the email using

<a href="%%=CloudPagesURL(ID)=%%">Check Balance</a>

Upon doing test emails I've ended up on the landing page URL with the Balance Points equal to 0.

I have the following Landing Page Pulling Data from Data Extension:

%%[
VAR @balance 
SET @balance = Lookup("CebuLandingPage-DE", "Balance", "Account_No", [Account_No])
IF  empty(@balance) THEN
SET @balance = "0"
ENDIF
]%%
As of %%=Format(Now(),"MMM. dd, yyyy,")=%%  you have: %%=v(@balance)=%% GetGo points

Is there something I'm missing?

How can I pull the Balance Point data from my data extension to be displayed on the Landing Page?

2
  • Is there a reason you're referencing Cebu-GetGo-MemberBalance-DE in the first script block and CebuLandingPage-DE in the second? Nov 9, 2016 at 16:48
  • Sorry the Cebu-GetGo-MemberBalance-DE is the actual DE, i replicated the DE as CebuLandingPage-DE as this is the one im using for the test. Nov 10, 2016 at 4:49

2 Answers 2

0

I assume that your account no corresponds to subscirber id. Missing link is that in the landing page, you need to pass the account no for which value needs to be fetched.

You need to do the following steps:

  1. In the Email Template, append the URL Link with the Account no against which you need to fetch the balance
  2. As an optional step, you can also encrypt the account no using ampscript function
  3. In the Landing page, use Requestparameter() ampscript function to retrieve the account no and assign it to a variable. If you have encrypted, decrypt it
  4. Now add your query above to the landing page to fetch the value.
1
  • RequestParameter() will work in if you append the parameter manually, but if he's arriving at the page from a link in an SFMC email, then the attributes of the subscriber are accessible via personalization string. Nov 9, 2016 at 16:40
0

Assuming you're arriving at the page from a link in a SFMC email, you can retrieve the value of Account_No with the AttributeValue() function:

%%[

var @balance, @Account_No
set @Account_No = AttributeValue("Account_No")
set @balance = Lookup("CebuLandingPage-DE", "Balance", "Account_No", @Account_No)

if empty(@balance) THEN
  set @balance = "0"
endif

]%%

As of %%=Format(Now(),"MMM. dd, yyyy,")=%%  you have: %%=v(@balance)=%% GetGo points

This code will work in an email also.

1
  • I managed to implement the above code on my landing page, and in the email . Ive included the link to the landing page on the email using the following: <a title="MyPage" href="%%=CloudPagesURL(936)=%%" alias="ThisAlias" conversion="false">Redeem Points</a> The AttributeValue() function: was able to work and pull data from the CebuLandingPage-DE in the Email, however once i click the link from the email to the landing page, i'm not still able to retrieve the value such as Balance and Account_No it does not return any value/data. Appreciate your help. Thank you. Nov 21, 2016 at 14:20

You must log in to answer this question.

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