- Welcome
- Introducing Babelway B2B Integration
- Starting with Babelway
- Managing Account Environments
- Managing Channels
- The Catalogue
- Tracking Messages
- Managing Alerts
- Managing Your Account
- Best Practices
- Channels
- List of Channels
- View Change Log
- General
- Gateway In
- Message In
- Transformation
- Message Out
- Gateway Out
- Email Gateway Out
- Ftp Client Gateway Out
- SFTP Client Gateway Out
- Ftp Server Gateway Out
- AS2 Gateway
- Http Client Out Gateway
- Web Gateway
- Generic Gateway
- Internal Gateway Out
- Null Gateway
- OFTP Server Gateway out
- OFTP client Gateway out
- Http Out Gateway
- SOAP Gateway
- Soap Client Out Gateway
- X.400 Gateway out
- Aggregator Gateway Out
- Email Gateway Out
- Email Notifications
- Routing
- Testing
- List of Channels
- Building a Channel
- The Catalogue
- Tracking Messages
- Alerts
- Account Management
- Rest API
- Receive Orders From
- Receive Orders from Colruyt
- Receive Orders from Carrefour
- Receive Orders from Brico
- Receive Orders from Castorama
- Receive Orders from Cora BE
- Receive Orders from Delfood
- Receive Orders from Delhaize
- Receive Orders from DEliXL
- Receive Orders from Intergamma
- Receive Orders from Intermarche
- Receive Orders from JavaFresh
- Receive Orders from Makro
- Receive Orders from Match
- Receive Orders from Carrefour France
- Receive Orders from Colruyt
- Integrate Orders with
- Integration with Tradeshift
- Integration with Exact Online or Exact Globe
- Channel:SAP Idoc XML Order05 w/ Http client out
- System Metadata
- ODETTE Messages List
- External References
See: Managing Channels - Message Transformation Functions
The Filter function is used to specify if the mapping result will be used as an output or not.
You can add a Filter function as an Xpath expression to any mapping rule to filter the output of this mapping rule, that is to decide if the result is output or not in the generated message out. Note that the Filter function will always return an element, but if the filtering condition is not met, this output will be empty.
The Filter can be used on any element but is most useful to filter loop elements and to generate only some of these elements according to the filter rule as illustrated in the following examples.
The Filter is done on the mapped element, that means that the filter context is the mapped element and that it can be immediately referenced using a ' . ' in the filtering Xpath expression.
The Filter function is applied on the mapped element and always returns a result. That is not the case for the If function that is applied before the mapping, meaning that, if the condition is not met, the mapping is not performed. See the If Function chapter for more details.
Filter example on a value node
In the following example, the node mapping is filtered on the Price value and the mapping output is used only if it is greater than 12 (Xpath filter expression is ' .>12 ').
Input csv file:
Code, Quantity, Price A23, 2, 12.5 A24, 3, 10.0 A25, 1, 15.2 A26, 2, 13.6
In the second ligne, the Price is lower than the filter value and the mapping output will be empty. Note that the output is generated and so the separating comma is present (as opposed to If function output).
Output csv file:
Code, Quantity, Price A23, 2, 12.5 A24, 3, A25, 1, 15.2 A26, 2, 13.6
Filter example on a loop node
In the following example, the entire line mapping is filtered on the Price value and the mapping output is used only if it is greater than 12 (Xpath filter expression is ' field[3]>12 ').
Now, using the same input file as in the previous example, the entire second line, for which the Price is lower than the filter value is not output in the out message file.
Output csv file:
Code, Quantity, Price A23, 2, 12.5 A25, 1, 15.2 A26, 2, 13.6
Babel Academy
Community Forum
Support



Prev


Up
Reference Manual