0

I'm having a bit of an issue. I created a CloudPage in the enterprise BU, and the purpose of this CloudPage is to display the following (actual screenshot of it retrieving Automations from the enterprise):

enter image description here

What I am trying to do is leverage prox.setClientId(...) to specify a certain child business unit to retrieve from. When I do this and reload the page, nothing is populated in the table. Here's the code that I have that has the prox.setClientId(...):

<script runat="server">
    Platform.Load("Core", "1.1.1");
    var prox = new Script.Util.WSProxy();
    prox.setClientId({ "ID": XXXXXXXX });

    //var buList = GetBUList();
  
    displayTable();

    function displayTable() {
        /* first time visiting the page */
      
        var cols = ["*", "CustomerKey", "Name", "ID", "Client", "Client.ID"];
        //var props = { QueryAllAccounts: true };
        var filter = {
            Property: 'Status',
            SimpleOperator: 'IN',
            Value: [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8]
        };
        var res = prox.retrieve("Automation", cols, filter);

When I save, publish, and reload the page, here's what I get:

enter image description here

My immediate thought was that this was not possible to do for Automations - but, I'm not sure. I even did the WSProxy advanced retrieve by specifying QueryAllAccounts = true, and when I do that and reload the page, I ONLY get the automations from the enterprise BU (above first screenshot).

4
  • @EazyE this is going from the Child BU to the Parent - I'm going from the Parent to the Child - which this particular question and comment I read seems to indicate that this should be possible.
    – Mike Marks
    Aug 26, 2021 at 17:16
  • In addition to this as well that he included in the question: Note: I tested to run my code at the Parent Level and impersonate the Child BU and the code was running successfully.
    – Mike Marks
    Aug 26, 2021 at 17:17
  • for what it's worth. A while ago I documented for myself that QueryAllAccounts seems not to help with automations. If everything fails, I would try to get into the BU context for the retrieve. If you don't have a ton of BUs, set up a cloudpage in each, let each one only get its %%memberId%%, and then HTTPGET the cloudpage in parent with memberId as parameter. make your parent page use requestParameter on memberid before running the code; result will be, you'll have one codebase in parent, plus 1 URL per BU that pulls in all the code but setting its own context, and will retrieve there. Aug 27, 2021 at 6:53

0

You must log in to answer this question.