0
<script runat="server" language="javascript">
  Platform.Load("Core","1.1.1");
  //retrieve all lists
  var lists = List.Retrieve();

  for(var i=0; i<lists.length; i++){
    Write(lists[i].ListName);
    var myList = List.Init(lists[i].ID);
    var subs = myList.Subscribers.Retrieve();
 var count =subs.length;
    Write(count);
    Write("<br>");
  }
</script>

Returns

All Subscribers0
TestPub0
TestTestPub0

This is currently querying every list in our BU, including all subs. It returns zero results for ever publication list we have, all of which have subscribers on them. Any ideas what could be causing this?

1 Answer 1

2

@Matt Goldstein Based on list Customer key you can retrieve dont use listid try like this

  <script runat="server" language="javascript">
  Platform.Load("Core","1.1.1");
   //retrieve all lists
   var lists = List.Retrieve();


  for(var i=0; i<lists.length; i++){
    Write(lists[i].ListName);
  var liid=lists[i].CustomerKey;
   var myList = List.Init(liid);
  var subs = myList.Subscribers.Retrieve();
   var count =subs.length;
   Write('the countis: '+count);

    Write("<br>");


   }
    </script>
0

You must log in to answer this question.

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