Hi everyone!
I've been working on a JSON file in Data Factory, and I'm having trouble properly flattening it. Here is a sample of the JSON file:
[
{
"_id": "fa8e22d6-c0b6-5229-bb9e-ad52eda39a0a",
"actual_price": "2,999",
"average_rating": "3.9",
"brand": "York",
"category": "Clothing and Accessories",
"crawled_at": "02/10/2021, 20:11:51",
"description": "Yorker trackpants made from 100% rich combed cotton giving it a rich look.Designed for Comfort,Skin friendly fabric,itch-free waistband & great for all year round use Proudly made in India",
"discount": "69% off",
"images": [
"https://rukminim1.flixcart.com/image/128/128/jr3t5e80/track-pant/z/y/n/m-1005combo2-yorker-original-imafczg3xfh5qqd4.jpeg?q=70",
"https://rukminim1.flixcart.com/image/128/128/jr58l8w0/track-pant/w/d/a/l-1005combo8-yorker-original-imafczg3pgtxgraq.jpeg?q=70"
],
"out_of_stock": false,
"pid": "TKPFCZ9EA7H5FYZH",
"product_details": [
{
"Style Code": "1005COMBO2"
},
{
"Closure": "Elastic"
},
{
"Pockets": "Side Pockets"
},
{
"Fabric": "Cotton Blend"
},
{
"Pattern": "Solid"
},
{
"Color": "Multicolor"
}
],
"seller": "Shyam Enterprises",
"selling_price": "921",
"sub_category": "Bottomwear",
"title": "Solid Men Multicolor Track Pants",
"url": "https://www.flipkart.com/yorker-solid-men-multicolor-track-pants/p/itmd2c76aadce459?pid=TKPFCZ9EA7H5FYZH&lid=LSTTKPFCZ9EA7H5FYZHVYXWP0&marketplace=FLIPKART&srno=b_1_1&otracker=browse&fm=organic&iid=177a46eb-d053-4732-b3de-fcad6ff59cbd.TKPFCZ9EA7H5FYZH.SEARCH&ssid=utkd4t3gb40000001612415717799"
}]
Everything is pretty straightforward except for the "product_details" section, which contains a list of several JSON objects with different pieces of data each. Unfortunately, the tools available in Data Factory, like Flatten and Select, only recognize the first object in the "product_details" array.
"product_details": [
{
"Style Code": "1005COMBO2"
},
{
"Closure": "Elastic"
},
{
"Pockets": "Side Pockets"
},
{
"Fabric": "Cotton Blend"
},
{
"Pattern": "Solid"
},
{
"Color": "Multicolor"
}
]
I'm looking for the best approach to process this kind of JSON files efficiently. How can I properly handle the "product_details" array with all its objects in Data Factory?
Thank you for your help!