ParseJSON to generate a list

I have a JSON data set that I would like to convert into a table. Is there a way to create a List out of JSON objects using ParseJSON?

Example link: JSON Parsing

My data

{
  "account-management": {
    "id": "account-management",
    "name": "Account Management",
    "shortcode": "ams",
    "uid": 110,
    "teams": [
      "team1"
    ]
  },
  "availability": {
    "id": "availability",
    "name": "Availability",
    "shortcode": "avs",
    "uid": 120,
    "teams": [
      "team2"
    ]
  },
  "reporting": {
    "id": "reporting",
    "name": "Reporting",
    "shortcode": "rps",
    "uid": 130,
    "teams": [
      "team3"
    ]
  }
}

I would like to be able to convert that data into a 3 record list with each of the objects as individual items in that list.

I am not expecting it to just magically work, but is it possible to automate this to create a table of records that is sourced from a JSON source? Ideally I would be able to also retrieve the data via a HTTP request to keep the table up-to-date automatically.

1 Like

Stay tuned, I believe that support for this sort of automated integration behavior is on the horizon!

1 Like

Hello there @JonO!
I managed to get it working as follows.

13 Likes

Great solution! Way to think outside the box/JSON!

1 Like

Thanks! I really know close to nothing about JSON, but I know Coda. :sweat_smile:

7 Likes

Love this. It’s so aligned with one of Coda’s passions which of to give everyone the superpowers of a developer! :grinning:

6 Likes

Has this feature now been implemented?

Is this what the FormulaMap function now does?

What feature are you looking for specifically?

Transforming JSON from an api into tables/rows? This is what you would do with custom packs

FormulaMap()/ForEach(), functionally equivalent formulas, allow you to loop through sets/lists of data

the published solution is using ParseJson() which is available in Coda for a long time.

the FormulaMap() (also knows as ForEach(), they are identical) will take a list and apply the formula you give it to EACH item in the list, combining all the results into a new list.

So, no, the FormulaMap() function is NOT for processing JSON directly.

2 Likes

Thanks… much appreciated.

I was a really early user of Coda in 2018-2019 and built some interesting docs but the limitations of the early app caused me to take a pause. I am quite pleased with the progress over the last few years - including Packs, Pack Studio, and OpenAI Pack among others. These are gamechangers and it looks like I can now complete the projects I was hoping to do then.

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