# Route Transformation

A Route transformation invokes one or more paths in the dataflow, in accordance with some decision logic expressed as a set of Rules. Using Route transformation, you can create some custom logic involving multiple paths and adapt it to suit your data processing scenario.

For example, a record passing some rule will be written into *Destination1*. A record passing another rule will be written to *Destination2*. A record passing still another rule will not go anywhere, and any remaining records will be fed to a downstream transformation object.

## **Steps**

To add a *Route* transformation, drag the *Route* object from the *Transformations* group in the Flow toolbox and drop it on the dataflow.

An example of what a Route object might look like is shown below.

![](https://627607815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xzBT0roYJkfVS5klkLl%2Fuploads%2FRLV3oOclTjArCXBsMmax%2F0.jpeg?alt=media)

To configure the properties of a Route object after it was added to the dataflow, right-click on it and select Properties from the context menu. The following properties are available:

* *Meta Object Builder* screen: It is used to add or remove fields in the field layout, as well as select their data type. The fields added in *Meta Object Builder* will show in the Input node inside the object box, as well as in all Rule nodes corresponding to the number of rules created (see below).
* *Router Transformation Properties* *screen*: Provides the interface to manage the Router rules.

Click the![](https://627607815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xzBT0roYJkfVS5klkLl%2Fuploads%2F1wGFT3CoblW00lZBfFzA%2F1.gif?alt=media)icon to create a new Router rule.

Type a descriptive name for the rule in the Description field.

In the *Expression* input, enter the expression making the rule. For example, LTV > 60 and LTV <= 80. Or click … to open *Expression Builder*, a tool that allows you to visually build your rule using Record Tree and Intellisense.

Click *Compile* to check for any syntax errors in your rule. The *Status* should read “Successful” for a successful compilation.

To activate the rule, check the *Active* switch.

Add other *Router* rules if necessary. To delete an existing *Router* rule, select it and click the ![](https://627607815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xzBT0roYJkfVS5klkLl%2Fuploads%2FC8fh3MSMTkoO0nLDRq7f%2F2.gif?alt=media)icon.

{% hint style="info" %}
**Note:** Each *Router* rule you add here will have its own *Rule* node in the Router object box once you close the *Properties* dialog. You can then map it to downstream objects on the dataflow as needed.
{% endhint %}

{% hint style="info" %}
**Note:** Any Route transformation object has the Default node. This node handles records not passing any rules defined in your Route transformation object.
{% endhint %}

* *General Options* screen: This screen shares the options common to most objects on the dataflow:
  * *Clear Incoming Record Messages*: When this option is on, any messages coming in from objects preceding the current object will be cleared. This is useful when you need to capture record messages in the log generated by the current object and filter out any record messages generated earlier in the dataflow.
  * *Do Not Process Records with Errors*: When this option is on, records with errors will not be output by the object. When this option is off, records with errors will be output by the object, and a record message will be attached to the record. This record message can then feed into downstream objects on the dataflow, for example, a destination file that will capture record messages or a log that will capture the messages and as well as collect their statistics.
  * The *Comments* input allows you to enter comments associated with this object.

## **Usage**

An example of using the Route transformation object is shown below.

![](https://627607815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xzBT0roYJkfVS5klkLl%2Fuploads%2F9PStAqXIaObwJV1ewqMd%2F3.png?alt=media)
