Last active
May 20, 2020 16:19
-
-
Save zuzannamj/1bece7ffd1c14347002baebf542f9239 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 getImports(objectType, cols) { | |
var prox = new Script.Util.WSProxy(), | |
objectType = "ImportDefinition", | |
cols = ["DestinationObject.ObjectID", "Description", "Name", "ObjectID"], | |
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++) { | |
if (data.Results[i].DestinationObject.ObjectID) { | |
var cols = ["Name", "CustomerKey", "ObjectID"]; | |
var filter = { | |
Property: "ObjectID", | |
SimpleOperator: "equals", | |
Value: data.Results[i].DestinationObject.ObjectID | |
}; | |
var deName = prox.retrieve("DataExtension", cols, filter); | |
if (deName.Results[0].Name) { | |
logDE.Rows.Add({ | |
DEName: deName.Results[0].Name, | |
DEKey: deName.Results[0].CustomerKey, | |
ActivityName: data.Results[i].Name, | |
ActivityType: "Import", | |
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