Monday, December 2, 2024

#1048 - OIC Integration Basics Lab 14 OIC Mapper

Mapping is one of the core activities you will be doing, when developing integrations. Syncing data between App A and App B will involve mapping fields from App A to App B. This mapping could be very simple or very complex, depending on your use case and the apps involved. The OIC Mapper works on different levels, this allows us to implement the most simple or most complex of mappings very easily. Let's now look at the different levels. 

Level 1 - simple source to target mapping 

Here you simply drag and drop a source field to a target field. 

The following possible sources are available -

  • For app or event driven integrations, the initial request payload or event payload. Think of an app driven integration to create a new customer in Netsuite. The integration has a REST trigger, so the request payload will be available as a source.
  • Integration Metadata
























  • Request and response payloads from any invokes performed by the integration e.g. the response payload from Netsuite on customer creation - 



































  • Variables, global variables, integration properties and tracking fields - 














Level 2 - using Functions 

All of the functions available are fully documented with examples - 






















So let's look at them - 























Advanced - I've highlighted some that are often used in file processing. generate-guid is also used to generate unique identifiers. There are ,of course, salient use cases for all of these functions.






















Boolean, Conversion and Date are self explanatory, at least I hope so!

Integration Cloud - getFlowId returns the instance id of the integration. This can be useful for a number of reasons, including compliance. isReplayed - tells us if this integration flow is a re-run.
lookupValue we've already met in the Lookups post.























String functions are often used, a typical example would be concat -  where you want to concatenate 2 or more source fields and then map the result to a target field. 

User Defined - includes functions that have been imported into the project e.g.

Operators

XSLT Constructors

























choose, when, otherwise
is very useful for conditional mapping. For example, only map the approver field when the incoming order is greater than $10k.

for-each (iterate over a specified sequence of fields) and for-each-group (select fields or nodes and organize into groups) 



















copy-of
is very useful for deep copying, i.e. your source and target structures are the same so just apply this at the node level, to avoid having to map all the individual fields.

Again, the documentation within the mapper is excellent, but you can always google to get more details. 

Developer View

The subtle difference here is I see the underlying field names, when I click Developer, otherwise, I see more user friendly element/field names.

Using Search

Some of these SaaS business objects can be very complex with many fields. Take my Netsuite customer object here. I need to map the Address fields, but where are they?














Filter Options

This is also very useful to de-clutter your mapping UI.

Code View

Here you see the underlying xslt which will be used at runtime to do the actual mapping.

You can also edit this, once you know what you're doing - 

Testing the Mapping

Mapping is the core of your integration flows, so the earlier you can test this, the better.

In the tester, you can generate inputs - 

You can, of course, edit what has been generated. 

Then click Execute to test - 















 





 



























 








No comments: