How to display JSON objects in repeating groups

The Reddit API is providing me with a JSON with the following structure:

“statusCode”: 200,

I have been attempting to display each object as each row in a repeating group like the following:

I have tested multiple plugins that parse JSON with no success so far. What would be the easiest way to achieve this?

For reference, here is the actual JSON:

    "statusCode": 200,
    "body": "[{\"title\": \"STOP USING PYTHON", \"url\": \"\", \"created_utc\": 1685041589.0, \"author\": \"C-O-S-M-O\"}, {\"title\": \"C++ talking to Python\", \"url\": \"\", \"created_utc\": 1658135273.0, \"author\": \"b98765\"}, {\"title\": \"javaToPython\", \"url\": \"\", \"created_utc\": 1708164237.0, \"author\": \"LinearArray\"}, {\"title\": \"Learning Python 2024\", \"url\": \"\", \"created_utc\": 1707664051.0, \"author\": \"Suspicious-Dentist93\"}, {\"title\": \"i use chatgpt to learn python\", \"url\": \"\", \"created_utc\": 1685611737.0, \"author\": \"Clinnkk_\"}, {\"title\": \"What can I do with python\", \"url\": \"\", \"created_utc\": 1703678993.0, \"author\": \"RPGNUB\"}, {\"title\": \"When is Python NOT a good choice?\", \"url\": \"\", \"created_utc\": 1699526730.0, \"author\": \"QueerKenpoDork\"}, {\"title\": \"What is the meaning of \\\"python is a script based language\\\"?\", \"url\": \"\", \"created_utc\": 1699352526.0, \"author\": \"WhatDelayIndustries\"}, {\"title\": \"pythonIsTheFuture\", \"url\": \"\", \"created_utc\": 1717499213.0, \"author\": \"utkarsh_aryan\"}, {\"title\": \"sneakyPython\", \"url\": \"\", \"created_utc\": 1714088450.0, \"author\": \"Oussama_Gourari\"}]"

Is the body an array in the response or a string?

Assuming the body is an array (not a string as in your example) then you shouldn’t need a plugin to do this.

  1. In your API connector settings, ensure it is being processed as a list:

  1. Ensure your action in the API call is set to “data”:

  1. Make the call in your front-end e.g. to house the api request:

  1. Then create a repeating group within that group to reflect the array (the “body”)

  1. Then create your cells and layout as needed within the repeating group:

If it’s a string then you will need to parse it. Maybe you could use a plugin… but you could do that without too using a little hack involving making multiple calls.

First, grab the “body” text from the source… then construct a JSON object and send it back to your own app to a back-end workflow and have it return JSON (I know this might seem odd but it’s well documented on the forum) then you can apply the steps above and simply throw it into a repeating group.

Hope it helps. Welcome to the forum!

1 Like

Hey thank you very much for the detailed answer! Definitely helped a lot :slight_smile:

To answer your question:

Is the body an array in the response or a string?

The body seems to be an Array wrapped in String (as shown in my sample in the original post).

In the API connector settings, I cannot find the “test json call body” as shown in your screenshot:

Since this API is a function that I wrote as a cloud function (AWS Lambda), should I return a JSON with a body that is an Array?

I updated my function and made the body into an array! Seems like it’s working now.

Thanks a lot!