Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the OneLake & Platform Admin teams for an ask US anything on July 16th. Join now.

Reply
KBD
Helper II
Helper II

File with Multiple JSON doc's - How to Merge them?

Hello:

 

I am working with files that contain multiple JSON doc's.

The files look something like this:

{"@odata.context":"https://xxxxdev.yyyy.us/contentapi/Facilities/$metadata#Facilities","value":[{"Fac_Id":247246,.........
{"@odata.context":"https://xxxxdev.yyyy.us/contentapi/Facilities/$metadata#Facilities","value":[]}

Each @odata  is return from a REST call.  There can be several until the empty one , the final one.

I need to combine the JSON docs.  Create one JSON object which will be processed futher. 

 

In a data flow I created a Source on top of a JSON dataset and set Document form to Document per line.

This read two records in the file 

KBD_0-1752522882885.png

 

Value in the first row contains the data I am interested in and in the second row value is empty.

Good.

How do I concatinate the two values to create one JSON object?

What transformations do I use?

Am I approaching this correctly?

 

Best Regards

 

KBD

 

 

 

 

 

2 REPLIES 2
v-venuppu
Community Support
Community Support

Hi @KBD ,

Thank you for reaching out to Microsoft Fabric Community.

Thank you @lbendlin for the prompt response.

You are reading multiple JSON documents (one per line), each with a value array.
Use Document per line in your JSON source to load them.Then apply a Flatten transformation on the value column to extract all items.This will combine all records from each JSON's value array into one dataset.Empty value arrays (like the last line) will be skipped automatically.

 

Thank you.

lbendlin
Super User
Super User

A standard "expand column"  should suffice.

 

please provide valid JSON responses for both scenarios.

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.