JSON Looper and nesting

I’m trying to figure out if the JSON looper in Pro is capable of taking JSON structure such as this:

[
    {
        "state": "North Carolina",
        "bars": [
                    {
                        "name": "Aunt Betty's Gin and Absinthe Bar",
                        "city": "Raleigh",
                        "website": "https://auntybettysbar.com/"
                    },
                    {
                        "name": "The Blind Pelican",
                        "city": "Holly Springs",
                        "website": "https://www.blindpelicanseafood.com/"
                    }
                ],
        "retail": [
                        {
                            "name": "Fuquay Spice & Tea",
                            "city": "Fuquay-Varina",
                            "website": "https://www.fvspice.com/"
                        }
                  ]
    }
]

and produce the following html:

  • North Carolina
    • Aunt Betty's Gin and Absinthe Bar
    • The Blind Pelican

etc.

Hello @readycog,

Thanks for writing in!

You will need to have a nested looper. For the first looper, use the Looper Provider JSON. For the second loop, you will have to use the Looper Provider Dynamic Content where this is you insert the {{dc:looper:field key="bars"}} and then in your Looper Consumer, you will have to have a Text element with the use the {{dc:looper:field key="name"}}, {{dc:looper:field key="city"}} and {{dc:looper:field key="website"}} dynamic content code to display for each entries.

Hope this makes sense.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.