0

I'm trying to set up a proxy retrieve to return the status of all automations that run for a particular day.

My current code is

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

var cols = [ "Name", "Status", "StartTime" ];

var simpleFilter =  {
  Property: "Name",
  SimpleOperator: "equals",
  Value: "MyAutomationName"
};

var complexFilter = {
  LeftOperand: {
     Property: "Name", 
     SimpleOperator: "like", 
     Value: "Prefix_%" 
  },
  LogicalOperator: "AND",
  RightOperand: {
    LeftOperand: {
        Property: "StartTime", 
        SimpleOperator: "greaterThanOrEqual",
        Value: "2022-08-20"
    },
    LogicalOperator: "AND",
    RightOperand: {
        Property: "StartTime",
        SimpleOperator: "lessThan",
        Value: "2022-08-21"
    }
  }
}  

data = prox.retrieve("AutomationInstance", cols, simpleFilter );

When I run with the simpleFilter, I get back expected results. But running with the complexFilter I get back

ErrorMessage: Object reference not set to an instance of an object.

Is it possible to use a complex filter in a WSProxy.retrieve? Or is there any other way to be able to retrieve the status of all automations whose name fits a given pattern, that ran on a particular day (or worst case, all the automations that run on a particular day, that I can then manually filter down to just those I'm interested in post-process)?

TIA!

1
  • Hey I know it has been quite a while.. but did you manage to resolve this? I have used complex filter with wsproxy before so I was wondering if this was caused by the "data" that wasn't declared in the program?
    – Ted Chan
    Mar 14 at 12:02

0

You must log in to answer this question.

Browse other questions tagged .