bradjasper / ImportJSON

Import JSON into Google Sheets, this library adds various ImportJSON functions to your spreadsheet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flatten JSON not create new rows

TheGeneralLedge opened this issue · comments

I would like to have my nested JSON appear on a single row instead of 2 rows - see example JSON below. At the moment I get two rows based on /result_summary/ID as the Innings Team batting ID is different. I would like to flatten all of this JSON into a single row but cant see which bit of the Code for ImportJSON I need to change to prevent the looping for each innings.

Any help would be much appreciated.

{
"result_summary": [
{
"id": 123456,
"status": "New",
"published": "Yes",
"last_updated": "01/01/2022",
"league_name": "",
"league_id": "",
"ground_name": "Lords",
"ground_id": "AB12345",
"home_team_name": "1st XI",
"home_team_id": "unique-ref",
"points": [],
"innings": [
{
"team_batting_id": "unique-ref",
"innings_number": 1,
"runs": "",
"wickets": "",
"overs": "",
"balls": "",
},
{
"team_batting_id": "unique-ref",
"innings_number": 1,
"runs": "",
"wickets": "",
"overs": "",
"balls": "",

            }
        ]
    },