I am trying to filter a data extension to only return certain rows via an SSJS automation.

It works fine if I set the SimpleOperator to "equals" and the Value to a static value.

What I really want to be able to do is filter on a number of values like this:

 var dataextensionexternalkey = 'externalkey';
 var dataExtension = DataExtension.Init(dataextensionexternalkey);
var filter = {Property:"LANGUAGE_CODE",SimpleOperator:"IN", Value:'"DA", "DE", "EN", "ES", "FR", "IT", "NL", "NO", "PL", "PT", "FI", "SV", "TR", "ZH"'};
var dataExtensionRows = dataExtension.Rows.Retrieve(filter);
Write('<hr>number of rows in filtered dataextension: ' + dataExtensionRows.length() + '<hr>');

But no rows are retrieved, it says: number of rows in filtered dataextension: 0

What am I doing wrong in the filter definition.

It works fine when I filter like this:

var filter = {Property:"LANGUAGE_CODE",SimpleOperator:"equals", Value:'EN'};

2 Answers 2


I found out how to make it work. You have to make an array of your IN values:

var availLanguagesArray = ["DA", "DE", "EN", "ES", "FR", "IT", "NL", "NO", "PL", "PT", "FI", "SV", "TR", "ZH"];
var filter = {Property:'LANGUAGE_CODE',SimpleOperator:'IN', Value: availLanguagesArray};

var sourceRows = sourceData.Rows.Retrieve(filter);

And Bob's your uncle...


In addition to the other answer:

If you are reading this and want to do it via SOAP instead of Rows.Retrieve (or perform a SOAP Call inside of your SSJS...), then it works differently - as I found out through trial and error:

here is an example of a retrieveRequest on Send Object:

<?xml version="1.0" encoding="UTF-8"?>
     <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
          <Filter xsi:type="SimpleFilterPart">

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .