Created
March 27, 2017 21:58
-
-
Save angrycider/0bb7f244784666d6d0713264d7e60db4 to your computer and use it in GitHub Desktop.
9. Complex filter retrieving a folder with a given parent and name.
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
//Complex filter | |
var parentFolderID = '99624'; //Hover over or inspect the folder and look at the CID querystring parameter | |
var options = { | |
filter: { | |
leftOperand: { | |
leftOperand: 'ParentFolder.ID', | |
operator: 'equals', //https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/creating_a_filterdefinition_object.htm | |
rightOperand: parentFolderID | |
}, | |
operator: 'AND', //https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/using_complex_filter_parts.htm | |
rightOperand: { | |
leftOperand: 'Name', | |
operator: 'equals', | |
rightOperand: '201703' | |
} | |
} | |
}; | |
SoapClient.retrieve( | |
'DataFolder', | |
["ID", "Name", "ParentFolder.ObjectID", "ObjectID"], | |
options, | |
function( err, response ) { | |
if ( err ) { | |
// error here | |
console.log( err); | |
return; | |
} | |
// response.body === parsed soap response (JSON) | |
// response.res === full response from request client | |
console.log( response.body ); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment