Constructing a nested JSON with Iterator

Status: Closed · Asked by mjv001 on · 0 views

mjv001 — Question ·

Is it possible to use Iterator and construct a nested json?
I want to retrieve the list of abandoned carts from Shopify but the response payload doesn't include the product Images for each line Items.
So I plan to use Iterator to loop through each line items per customer and retrieve the product image/details then reconstruct the JSON payload

Highlevel workflow is like this

  1. Shopify-Abandoned Carts
  2. Iterator per Customer
  3. Iterator per Customer - Line Item
  4. Shopify-Get Product Images
  5. Construct a JSON
  6. POST to my API

{
"Customer": [
{
"id": "UID001",
"email": "[email hidden]",
"line_items": [
{
"product_id": "PID001",
"quantity": 1,
"title": "Prouct 1",
"line_price": "100.00",
"image_src": "https://xxx"
},
{
"product_id": "PID002",
"quantity": 1,
"title": "Prouct 2",
"line_price": "200.00",
"image_src": "https://xxx"
}
]
},
{
"id": "UID002",
"email": "[email hidden]",
"line_items": [
{
"product_id": "PID001",
"quantity": 2,
"title": "Prouct 1",
"line_price": "100.00",
"image_src": "https://xxx"
},
{
"product_id": "PID002",
"quantity": 2,
"title": "Prouct 2",
"line_price": "200.00",
"image_src": "https://xxx"
}
]
}
]
}

Pabblymember11 — Reply ·

Hey @mjv001

We have replied to your query on your another thread. So, kindly check that out.

PatrickInt — Reply ·

@Supreme Can you link to the other thread as I can't find it and need this nested iterator solution too.
Thanks

Pabblymember11 — Reply ·

Hey @PatrickInt

You can refer to the following video tutorial on round robin to distribute the iteration in separate routes.

youtube.com/watch?v=YffqBuk_S5o

Back to all forum threads · Log in to reply