bradjasper / ImportJSON

Import JSON into Google Sheets, this library adds various ImportJSON functions to your spreadsheet
GNU Lesser General Public License v3.0
2.1k stars 1.06k forks source link

Flatten JSON not create new rows #245

Open TheGeneralLedge opened 1 year ago

TheGeneralLedge commented 1 year ago

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": "",

            }
        ]
    },