Skip to main content

#Wsproxy0 人がディスカッション中

Hi All,

 

I've been trying to use WSProxy to dynamically update publication lists in multiple child BU's using an SSJS activity in an Automation.

I've noticed very strange behaviour where the script executes successfully and I'm getting a successful response from the WSProxy API, however the subscriber isn't getting updated in the corresponding Publication List.

 

In my real automation, I populate a DE with the details of the subscribers who need to be resubscribed and use the DE data as my source for the script activity

 

Sample code below:

 

<script runat="server">

    Platform.Load("core", "1.1");

    var api = new Script.Util.WSProxy();

    var buId = nnnnnn;

    var listId = llllll;

        api.setClientId({"ID": buId});

        var options = { 

            SaveOptions: [{

              PropertyName: "*",

              SaveAction: "UpdateAdd"

            }]

        };

        try {

            var sub = {

                SubscriberKey: "SubKey1",

                EmailAddress: "xxx@xxx.com.au",

                Lists: [{

                    ID: listId,

                    Status: "Active"

                }]

            };

            var resp = api.createItem("Subscriber", sub, options);

              Write(Stringify(resp));

        } catch(e) {

          Write(Stringify(e));

        }

          api.resetClientIds();

</script>

 

Has anyone else noticed this behaviour in their environment?

I will be raising a case with SF as well, but hopefully someone here has a solution/workaround.

 

#MCExperts #MCDeveloper  #wsproxy, #ssjs#SSJS Script , #Marketing Cloud Publication Lists 

@Andrew Ormerod @Ned Atanasovski  

7 件のコメント
  1. 2022年8月24日 15:20

    @Grace Call 

    To make the mid dynamic here is the code :

    Platform.Recipient.GetAttributeValue('memberid'); //SSJS

     

    What you could have tried - copy the SSJS into a code snippet in the shared folder, call the code snippet in the child BU cloud page or Automation SSSJ script activity.

     

    <script runat="server">  var ampscriptCode = Platform.Function.ContentBlockByID("12345"); </script>

0/9000

Hello how are you ? I need your help because I find myself with the problem of executing an automation in automation Studio that has failed due to Time Out or other reason, for which I need it to be executed automatically when it fails so that it can complete.

Has anyone managed to do this? I stay tuned and thank you very much for your help.

 

Regards.

10 件のコメント
  1. 2021年3月4日 0:06
    Hello how are you ? @Yosef Sahler @Adam Spriggs @Jennifer Dietrich, Thank you for all your comments, we will begin to review what you propose and carry out tests, we will comment if we achieve something with your suggestions, thank you !! Have a good week
0/9000