SF Marketing Cloud : Getting All the List associated to Subscriber Email Address


NOTE : Replace $ icon with < icon. I have replaced it as facing some technical issue while writing on Blog.

UI FORM SECTION

$!DOCTYPE html>
$html>
$title>Getting All the List associated to Subscriber Email Address$/title>
$body>
$h2>Getting All the List associated to Subscriber EmailAddress$/h2>
$form action=”URL OF PUBLISHED CLOUD PAGE” method=”post”>
Enter Your Email Address Here:
$input type=”text” name=”emailId” value=””>
$br>
$input type=”submit” value=”Submit”>
$/form>
$/body>
$/html>

PROCESSING PAGE SECTION :

$html>
$title>Getting All the List associated to Subscriber Email Address$/title>
$body>
$h2>Getting All the List associated to Subscriber EmailAddress$/h2>
$script runat=server>
Platform.Load(“Core”,”1″);

var emailId = Platform.Request.GetFormField(‘EmailId’);//This Value will come from UI Form
var data = DataExtension.Init(“SSJS_Preferences”);
var SubKey;

//emailId = “test@test.com”;//For Testing I have given manual email Id here.

//Start : Getting Subscriber Key
var subObj = Subscriber.Retrieve({Property:”EmailAddress”,SimpleOperator:”equals”,Value:emailId});
for(i = 0 ; i$subObj.length; i++)
{
SubKey = subObj[i].SubscriberKey;
}
//End : Getting Subscriber Key

var subObj = Subscriber.Init(SubKey);
var listArray = subObj.Lists.Retrieve();
Write(Stringify(listArray));
$/script>
$/body>
$/html>

Advertisements


Categories: Cloud

Tags: , , , , , , , , , , , , , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: