Quantcast
Channel: Active questions tagged ampscript - Salesforce Stack Exchange
Viewing all articles
Browse latest Browse all 359

Accessing subscriberkey from a Cloud Page

$
0
0

So I've been through this question and the answers, but am still having some trouble building a CloudPage that retrieves SubscriberKey from the URL. It works if I hardcode a Salesforce record ID as "@Id":

%%[var @Id, @firstName, @lastName, @email, @subscriberRows, @subscriberRow, @OptIn, @OptOutset @Id = "0030O00002GHNIvQAP"IF RequestParameter("submitted") != true THENset @subscriberRows = RetrieveSalesforceObjects("Contact","FirstName,LastName,Email,HasOptedInToEmail__c,HasOptedOutOfEmail","Id", "=", @Id )]%%

but if I try to "retrieve" the subscriberkey as described elsewhere

%%[var @Id, @firstName, @lastName, @email, @subscriberRows, @subscriberRow, @OptIn, @OptOutset @Id = RequestParameter("Subscriberkey")IF RequestParameter("submitted") != true THENset @subscriberRows = RetrieveSalesforceObjects("Contact","FirstName,LastName,Email,HasOptedInToEmail__c,HasOptedOutOfEmail","Id", "=", @Id )]%%

The page doesn't preview and if I go ahead and publish it I get an Internal Server Error when I go to the URL. The page is a CloudPage Landing Page, and I have created a link in an email using the Cloud Page - Landing Page link function. the HTML produced in the email looks like this:

<a alias="" conversion="false" data-linkto="cloudpageslandingpage" href="%%=CloudPagesURL(176)=%%" style="color:#808080;text-decoration:none;" title="">Simplified page</a>

Viewing all articles
Browse latest Browse all 359

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>