Created
May 20, 2020 16:02
-
-
Save zuzannamj/3b7426f2a8cfc15c701350af08cd77e5 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
function getQueries(objectType, cols) { | |
var prox = new Script.Util.WSProxy(), | |
objectType = "QueryDefinition", | |
cols = ["Name", "Description", "ObjectID", "DataExtensionTarget.Name", "DataExtensionTarget.CustomerKey"], | |
moreData = true, | |
reqID = null, | |
numItems = 0; | |
while (moreData) { | |
moreData = false; | |
var data = reqID == null ? prox.retrieve(objectType, cols) : prox.getNextBatch(objectType, reqID); | |
if (data != null) { | |
moreData = data.HasMoreRows; | |
reqID = data.RequestID; | |
if (data && data.Results) { | |
for (var i = 0; i < data.Results.length; i++) { | |
logDE.Rows.Add({ | |
DEName: data.Results[i].DataExtensionTarget.Name, | |
DEKey: data.Results[i].DataExtensionTarget.CustomerKey, | |
ActivityName: data.Results[i].Name, | |
ActivityType: "Query", | |
ActivityDescription: data.Results[i].Description | |
}); | |
numItems++; | |
} | |
} | |
} | |
} | |
Write("<br />" + numItems + " total " + objectType + "<br>"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment