[SalesForce] How to pull data from Data Extension to be displayed in Landing Page

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?

Best Answer

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.
Related Topic