0

I'm doing some research into using SSJS to build a custom preference center in SFMC Cloud Pages.

Could someone expound on what information is returned in the array from the Lists.Retrieve() call? The SF documentation only says:

Returns an array of information on the lists of which the initialized subscriber is a member

Does it return a array of strings of the lists the subscriber is on? Is it an array of List IDs?

0

Basically, Lists.Retrieve() will pull in the list information to which that subscribed is linked to.

Here is an example:

Code:

<script runat="server">
Platform.Load("core","1");
  var subObj = Subscriber.Init("Subscriber_Key_Here");
  var listArray = subObj.Lists.Retrieve();
  var Stringlists = Stringify(listArray);
  var StatuslistArray = Write(Stringlists);
</script>

Result:

[
{
    "List":
    {
        "ID": 12345,
        "Name": "All Subscribers",
        "Description": "Contains all subscribers",
        "Type": "Private",
        "CreatedDate": "2014-07-22T09:01:43.940"
    },
    "CreatedDate": "2017-11-23T23:50:00.000",
    "Status": "Active"
}]

Note: The result will be different on subscriber basis.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.