Skip Ribbon Commands
Skip to main content
Navigate Up
Sign In

Quick Launch

Average Rating:

facebook Twitter
Email
Print Bookmark Alert me when this article is updated

Feedback

HOW TO: Merge multiple records into a single JSON array using Data Processor
Solution
Consider the data fed to the Data Processor is:
John,Doe,1
Jane,Doe,1
Jack,Doe,1

The target should be a JSON file that has a single root element containing all the above records as a JSON array.
In order to achieve this, make sure the key value of the records that are to be merged as a single array, is the same.

JSON_array.png

The last column was linked with the Key/FKey.. port of the Data Processor, in the required group.
We need to make sure that all the records that are supposed to be a part of a single array, have the same value of Key values fed to the DP.

This will result in the array as follows:
-------------
[{"employees":[{"firstName":"John","lastName":"DOE"},{"firstName":"Jane","lastName":"DOE"},{"firstName":"Jack","lastName":"DOE"}]}]
-------------
More Information
Reference
Applies To
Product: PowerCenter; Data Engineering Integration(Big Data Management); Data Engineering Quality(Big Data Quality); Data Engineering Streaming(Big Data Streaming); Data Quality
Problem Type: Configuration
User Type: Developer
Project Phase: Implement
Product Version:
Database:
Operating System:
Other Software: Unstructured Data
Attachments
Last Modified Date:8/11/2020 11:01 PMID:618545
People who viewed this also viewed

Feedback

Did this KB document help you?



What can we do to improve this information (2000 or fewer characters)