Use Cases & Code Samples

Concatenating Filters

if you need to use the filter object for the <resource>.search function - you can use the below helper function to build your filter nodes easily:

function concatFilters(f1, f2, and) {
return {
"Operation":(and ? "AND" : "OR"),
"LeftNode":f1,
"RightNode":f2
};
}

now call the function and build your filter object:

var uuids = // your attachments in an array
var filter = { "Operation":"IsEqual", "ApiName":"UUID", Values:[uuids[0]] };
for (var i = 1; i < uuids.length; i++) {
filter = concatFilters(filter,
{ "Operation":"IsEqual", "ApiName":"UUID", Values:[uuids[i]] });
}