This is the most common use case. You take nested output from a web service or API and transform it into a flat data structure, then store it in a relational database or flat file.
In Integrator the "nested to flat" mapping can be completely accomplished using drag-and-drop, with no coding involved.
Step 1. As usual, create a transformation by defining the source (FROM) and the destination (TO) where the source is a nested data object (for example users.json) and the destination is a flat file (for example users.csv).
Step 2. Define a mapping by clicking the
Create Mapping button. Integrator reads the nested data source object and creates the mapping automatically.
if the source object is not available when you create a flow, you can "design" it yourself by using a combination of these buttons:
Add field mapping,
Mark this field as a childand
Move child field one level up.
Step 3. Map fields in the source (FROM) to the fields in the destination (TO). It is recommended that you exclude the parent field but keep the child fields. In the example above, if the parent fields
phoneNumbers are excluded, the following flat dataset would be created:
firstName lastName who why age streetAddress city state postalCode phoneNumber_type phoneNumber
You might ask, what will happen if there are multiple phone numbers for a single user? If we merely map fields as in the example above, Integrator will only find the first phone number, and will skip all the others.
firstName lastName who why age .... phoneNumber_type phoneNumber Duke Java duke because 18 .... Mobile 111-111-1111