Created
July 27, 2021 12:24
-
-
Save MamaiRachid/992590200fe09eaaad0bad7a8cb62273 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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