Skip to content

Instantly share code, notes, and snippets.

@MamaiRachid
Created July 27, 2021 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MamaiRachid/992590200fe09eaaad0bad7a8cb62273 to your computer and use it in GitHub Desktop.
Save MamaiRachid/992590200fe09eaaad0bad7a8cb62273 to your computer and use it in GitHub Desktop.
Platform.Load("Core","1");
var api = new Script.Util.WSProxy();
try {
/* Retreive Automations_Monitoring_List DE automations that need to be monitored */
var deCustKey = 'Automations_Monitoring_List';
var cols = ["AutomationName", "toBeMonitored"];
var filter = {
Property: "toBeMonitored",
SimpleOperator: "equals",
Value: true
};
var deReturn = api.retrieve("DataExtensionObject[" + deCustKey + "]", cols, filter);
var automationName = "";
for (var a = 0; a < deReturn.Results.length; a++) {
var results = deReturn.Results[a];
for (var i = 0; i < results.Properties.length; i++) {
var value = results.Properties[i].Value;
if (results.Properties[i].Name == "AutomationName") {
Write(Stringify(value + " : "+ getAutomationStatus(results.Properties[i].Value) + " || "));
}
}
}
} catch(err) {
var error = {
Status: 500,
Message: err
}
Write(Stringify(error));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment