How to render array of items from JSON? Any ideas?

Hello all :waving_hand:,
please, could someone guide me with using the right functions for my scenerio?

I’m scraping data from a site (example.json (3.7 KB)) with this kind of structure:

{
“bikeCategories”: [
“Bikes”,
“Road Bikes”,
“Performance Road Bikes”,
“Tarmac”
],
“skuVariants”: [
{
“color”: “GLOSS RED SKY / CHROME”,
“size”: “44”,
“partNo”: “94926-1044”
},
{
“color”: “GLOSS RED SKY / CHROME”,
“size”: “49”,
“partNo”: “94926-1049”
},

and I want to generate this kind of output inside the Google Docs template (or anywhere else):

[partNo] - [bikeCategories(2)] - [color] - [size]

“94926-1044 - Road Bikes - GLOSS RED SKY / CHROME - 44”,
“94926-1049 - Road Bikes - GLOSS RED SKY / CHROME - 49”,
“94926-1052 - Road Bikes - GLOSS RED SKY / CHROME - 52”,
“94926-1054 - Road Bikes - GLOSS RED SKY / CHROME - 54”,
“94926-1056 - Road Bikes - GLOSS RED SKY / CHROME - 56”,
“94926-1058 - Road Bikes - GLOSS RED SKY / CHROME - 58”,
“94926-1061 - Road Bikes - GLOSS RED SKY / CHROME - 61”,
“94926-1644 - Road Bikes - GLOSS SILVER DUST / SHADOW SILVER DRY IMPASTO / PHOTON ORANGE TINT OVER SILVER DUST - 44”,
“94926-1649 - Road Bikes - GLOSS SILVER DUST / SHADOW SILVER DRY IMPASTO / PHOTON ORANGE TINT OVER SILVER DUST - 49”,
“94926-1652 - Road Bikes - GLOSS SILVER DUST / SHADOW SILVER DRY IMPASTO / PHOTON ORANGE TINT OVER SILVER DUST - 52”,
“94926-1654 - Road Bikes - GLOSS SILVER DUST / SHADOW SILVER DRY IMPASTO / PHOTON ORANGE TINT OVER SILVER DUST - 54”,
“94926-1656 - Road Bikes - GLOSS SILVER DUST / SHADOW SILVER DRY IMPASTO / PHOTON ORANGE TINT OVER SILVER DUST - 56”,
“94926-1658 - Road Bikes - GLOSS SILVER DUST / SHADOW SILVER DRY IMPASTO / PHOTON ORANGE TINT OVER SILVER DUST - 58”,
“94926-1661 - Road Bikes - GLOSS SILVER DUST / SHADOW SILVER DRY IMPASTO / PHOTON ORANGE TINT OVER SILVER DUST - 61”,
“97225-0249 - Road Bikes - Gloss Glacial Metallic / Red To Gold Pearl / Satin Silver Dust - 49”,
“97225-0252 - Road Bikes - Gloss Glacial Metallic / Red To Gold Pearl / Satin Silver Dust - 52”,
“97225-0254 - Road Bikes - Gloss Glacial Metallic / Red To Gold Pearl / Satin Silver Dust - 54”,
“97225-0256 - Road Bikes - Gloss Glacial Metallic / Red To Gold Pearl / Satin Silver Dust - 56”,
“97225-0258 - Road Bikes - Gloss Glacial Metallic / Red To Gold Pearl / Satin Silver Dust - 58”,
“97225-0261 - Road Bikes - Gloss Glacial Metallic / Red To Gold Pearl / Satin Silver Dust - 61”,
“97225-0349 - Road Bikes - Satin Doppio / Gunmetal Dry Brushed / Gold Pearl - 49”,
“97225-0352 - Road Bikes - Satin Doppio / Gunmetal Dry Brushed / Gold Pearl - 52”,
“97225-0354 - Road Bikes - Satin Doppio / Gunmetal Dry Brushed / Gold Pearl - 54”,
“97225-0356 - Road Bikes - Satin Doppio / Gunmetal Dry Brushed / Gold Pearl - 56”,
“97225-0358 - Road Bikes - Satin Doppio / Gunmetal Dry Brushed / Gold Pearl - 58”,
“97225-0361 - Road Bikes - Satin Doppio / Gunmetal Dry Brushed / Gold Pearl - 61”
]

Is there a way to render this text from an array of objects with functions?

Any help would be amazing. Thank you! :folded_hands:
Matyáš

1 Like

Heyy @Matyas_Kopp

You can follow these steps are Parsing the JSON:

  1. Parse JSON

  2. Use iterator after that and map “skuVariants” array to iterate items from parse JSON

  3. Use text aggregator module after Iterator and do the mapping as shown below. As you want to combine all bundle from JSON parsed, you need to choose Source Module in Text aggregator as Parse JSON module. Also as you need 2nd item from BikeCategory, you need to enter 2 in between the square bracket gap of that array.

  4. Your desired output.

This will help in getting the full text block for further use.

Let me know if you need more help!

Best,
@Prem_Patel

Hello Prem,

thank you so much for your advice, now it works perfectly! :grinning_face_with_smiling_eyes:

Have a great day!
Matyáš

1 Like

Glad it helped you! @Matyas_Kopp
Best,
@Prem_Patel