- 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
You can easily add a counter using a custom drag and drop transformation function.
You can add a counter in a custom drag and drop transformation function. Use the Xpath ' position() ' to implement this local counter in your transformation.
Additionally, it is also possible to keep track of a counter from one transformation to another by implementing it into a lookup table and applying it using the custom function ' lookup table counter '.
To implement a "persistent" counter:
Create a lookup table named ' counters ' with two columns named ' name, value '.
Add an entry (mycounter, 0).
In the transformation screen, add a transformation function type : LookupTable / LookupTable Increment Value.
Select the table to ' counters ' and the IN to ' name ' and OUT to ' value '.
Now create a new transformation function ' contant string ' with a value of ' mycounter '.
Drag the contant string as the argument of the lookup table.
You are now ready to use the counter in you mapping. Each time the counter is used, the value will be incremented by 1.
Example
Make a counter of segments during XML incoming message file transformation.
Example: SEGMENT A (multiple segments possible) - FIELD A1 - FIELD A2
In this example, how to make a dynamic counter to count all segments A where the field A1 = "009"?
To count all segments A with field A1='009', use the following custom Xpath function: count(A[A1='009']) and map it to the target segment.
To ignore the loop on the counter that resets this counter, use a custom Xpath function with the following code: 1 + count(preceding-sibling::subelement) + count(../preceding-sibling::element/subelement) where element is the name of element used with loop1 and subelement is the name of element used with loop2.
Do not forget to link the relevant loop to your custom rules in order to access proper relevant data.
Babel Academy
Community Forum
Support



Prev
Up
Reference Manual