I faced strange situation. I am trying to retrieve all Data Filters from the specific Business Unit from salesforce Marketing Cloud.
on the marketing cloud SDK help page there is info that filterDefinition object has property as "Client"
I need to do the documentation and also list all the Data filters from specific BU. this is my code. without part of the "Client" property is working, downloading all the Data filters in the system to the target Data Extension, which is not helping because I need to filter them somehow to achieve specific list for specific BU.
<script runat=server>
Platform.Load("Core","1.1.1");
var prox = new Script.Util.WSProxy(); // Sets the Proxy - DO NOT CHANGE
var custKey = "xxx-xxxx-xxxxx-xxxxx";
var logDE = DataExtension.Init(custKey);
var cols = ["Name","CustomerKey","Client"];
var reqID = null
var moreData = true;
var desc = [];
while(moreData) {
moreData = false;
var data = reqID == null ?
prox.retrieve("FilterDefinition", cols) :
prox.getNextBatch("FilterDefinition", reqID);
if(data != null) {
moreData = data.HasMoreRows;
reqID = data.RequestID;
if(data && data.Results) {
for (var i = 0; i < data.Results.length; i++) {
var name =data.Results[i].Name
var clientid =data.Results[i].Client
var customerkey = data.Results[i].CustomerKey
logDE.Rows.Add({
CustomerKey: customerkey,
Name: name,
ClientID: clientid
});
}
}
}
}
I would really appreciate the help with this case. I looked I think everywhere trying to find FilterDefinition property which will contains the Business Unit ID.
Regards!.