I need to update SubscriberLists from different child Business Units. To do that I create Subscriber and put SubscriberLists inside of it. How can I specify ClientId of Business Unit for every SubscriberList?


I'm trying to update it with following code and I don't know how to set clientId for every SubscriberList in for loop:

SET @sub = CreateObject("Subscriber")
SetObjectProperty(@sub,"SubscriberKey", QUERYPARAMETER('key'))

FOR @d = 1 TO RowCount(@sublistArray) DO
    SET @listRow = Row(@sublistArray, @d)
    SET @listId = Field(@listRow, 1)

    SET @list = CreateObject("SubscriberList")
    SetObjectProperty(@list,"ID", @listId)
    SetObjectProperty(@list,"IDSpecified", "true")
    SetObjectProperty(@list,"Status", @listStatus)
    SetObjectProperty(@list,"StatusSpecified", "true")
    AddObjectArrayItem(@sub,"Lists", @list)

Set @update_list_sub = InvokeUpdate(@sub, @update_sub_status, @update_sub_errorcode) 
  • How are you making these updates - you've tagged AMPscript so assuming this is with AMPscript on a landing page. Do you have any code to work from? Nov 8 '17 at 17:56
  • @AnonWonderer updated question Nov 9 '17 at 9:28

Your code seems fine - you will just need an additional statement to specify a child ID property and to populate that with the MID of the specific business unit. Try this within your code:

   SET @client = CreateObject("ClientID")
   SetObjectProperty(@client, "ID", [Insert MID of specific BU here])
   SetObjectProperty(@client, "IDSpecified", "true")
   SetObjectProperty(@sub, "Client", @client)
  • Yes, I did it, but that way I will need to create Subscriber for every clientId. I wanted to avoid it, specify clientId for every SubscriberList and update it with one query Nov 11 '17 at 17:19

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.