This transformation step allows you to define rules which include or exclude specific rows from the data as a result of the transformation. The Filter Rows step is useful as a means of data cleaning to meet the requirements for data import for example.
Step configuration

- In the Data Transformation Studio, add the Filter Rows step.
- Indicate the columns whose values will be checked.
- In the Where value section, from the dropdown list, select a logical operator. The rows in which the values meet the condition are kept, and the other rows are removed. The comparison is case-sensitive, for example,
usadoesn't matchUSA- Equal - the value is equal to the string you provide.
- Not equal - the value is different from the string you provide.
- Ends with - the value ends with a character or sequence you provide.
- Starts with - the value starts with a character or sequence you provide.
- Contain - the value contains a substring or character you provide.
- Not contain - the value doesn't contain a substring or character you provide.
- In the field next to the dropdown list, enter the value.
- To add more rules, click Add rule and repeat steps 2-4.
The rules are performed one after another, so a row is kept only if it meets the conditions of all the rules. - To define what happens if rows contain errors, from the dropdown list next to Add rule, select one of the error handling options.
- Confirm the settings by clicking Apply.
- You can check the result in the Output tab.
Selecting columns
In each rule of the step, you indicate the columns on which the operation is performed.
- In the header of the rule, click these and select one of the options:
- these - the operation is performed on the columns you indicate.
- all except these - the operation is performed on all columns except the ones you indicate.
- From the first dropdown list in the rule, select how you want to indicate the columns:
- Columns - from the Select column dropdown list, select one or more columns.
- Where name - define a condition (a dynamic condition) that the column names must meet. Select a logical operator (Ends with, Starts with, Contain, Not contain, or Regex) and enter the value. For example, if you select Starts with and enter
pro, the operation is performed on the columns whose names start withpro
Column names are case-sensitive, for example,productdoesn't matchProductCode. A regular expression must match the entire column name, for example,product.*matchesproductName, butproductdoesn't. To ignore the letter case in a regular expression, add(?i)at the beginning, for example,(?i)product.*
You can't combine dynamic conditions with the all except these option.
Dynamic conditions are especially helpful when you use a JSON file as sample data. When a JSON file contains an object deeper than the root object, its items are transferred to the transformation as separate columns named {object}.{parameter}. You can't add those columns from the Select column list, but you can include them with a dynamic condition, for example, by including columns whose names contain the name of the object they were created from.
Handle errors
You can define what happens with rows in which the step fails (for example, as a result of Jinja rendering). From the dropdown list next to Add rule, select one of the following options:
- Skip row if error occurred - It omits the row when an exception occurs.
- Skip if result is null or empty string - It omits rows with empty strings and
null(which may be the result of rendering Jinja). - Stop further transformation - The transformation stops at the row with an error. The data before the line that caused the error is transformed (and imported if the transformation is used in the Data Transformation Studio node).
- Insert null if error occurred - Wrong values are replaced with
null. If you use such a transformation for the import of profiles, the existing value of an attribute is cleared and replaced with thenullvalue. - Insert empty string if error occurred - Wrong value is removed and the cell remains empty.
Example of use
Let's assume you want to import a file with USA customers to Synerise, however, the file contains customers from all around the world. To prepare such a file for import, you can create a transformation that includes the Filter Rows step and use it in a workflow that imports selected customers.
File used in this example
email,name,surname,country john.doe@example.com,John,Doe,USA john.smith@example.com,John,Smith,Germany stella.woods@example.com,Stella,Woods,USA rajesh.doe@example.com,Rajesh,Doe,Singapore rajesh.smith@example.com,Rajesh,Smith,India marco.gomez@example.com,Marco,Gomez,Spain kate.johnson@example.com,Kate,Johnson,USA jane.williams@example.com,Jane,Williams,USA rachel.brown@example.com,Rachel,Brown,England frank.davis@example.com,Frank,Davis,USA pierre.perez@example.com,Pierre,Perez,France rob.harris@example.com,Robert,Harris,Wales lee.lewis@example.com,Lee,Lewis,USACreating rules for modifying the file with customer data
- Go to
Automation Hub > Transformations > New transformation.
- Enter the name of the transformation.
- Add sample data from the file with customers.
- Click Add step and select Filter Rows. In the configuration of the step:
- Leave the these option at default.
- From the Select column dropdown list, select country.
- In the Where value section, leave the Equal operator selected.
- In the field next to the dropdown list, enter the name of the country. In this example, it's
USA - Confirm by clicking Apply.
Result: In the Output tab, the data contains only customers from the USA.
- Click Save.
What's next: You have created a transformation that contains the rules of transforming the file of a defined structure. The file used in the example contains a column with a unique identifier (in this case, email) which is required for importing customers, so it is possible to proceed to creating a workflow that uses this transformation and imports the USA customers.
Importing selected customers
- Go to Automation Hub > Workflows > New workflow.
- Enter the name of the workflow.
- Start with the Scheduled Run node. In the configuration of the node:
- Set the Run trigger option to one time.
- Select the Immediately tab.
- Confirm the settings by clicking Apply.
- Add the Local File node. In the configuration of the node, upload the file with customers.
- Add the Data Transformation Studio node. In the configuration of the node:
- Click Templates library.
- Select the transformation you prepared before.
- Click Apply.
- Add the Import Profiles node. This node doesn't require configuration.
- Add the End node.

The final configuration of the import profiles workflow - Click Save and publish.