Google-api-nodejs-client: sheets.spreadsheets.batchUpdate insertDimesion doesn't accept inheritBefore parameter

Created on 30 Jun 2016  路  1Comment  路  Source: googleapis/google-api-nodejs-client

Using google sheet v4 API, bactchUpdate insertDimesion doesn't seem to work when inheritBefore is specified

https://developers.google.com/sheets/samples/rowcolumn#insert_an_empty_row_or_column

sheets.spreadsheets.batchUpdate({
        spreadsheetId: config.SPREAD_SHEET_ID,
        resource: {
            requests: [
                // {
                //     appendDimension: {
                //         sheetId: config.SHEET_ID,
                //         dimension: 'ROWS',
                //         length: all_rows - max_rows
                //     }
                // }
                {
                    "insertDimension": {
                        "range": {
                            "sheetId": config.SHEET_ID,
                            "dimension": "ROWS",
                            "startIndex": max_rows,
                            "endIndex": all_rows - max_rows
                        },
                        "inheritBefore": true
                    }
                }
            ]
        }
    }, callback);

An error is received with follow message

Invalid JSON payload received. Unknown name "inherit_before" at 'requests[0].insert_dimension': Cannot find field.

While appendDimesion works fine.

Looks like this is actual API's issue, not the libraries' issue though?

Most helpful comment

Just solved my own problem, the example is using the wrong field name, it should be

"inheritFromBefore": true

not

"inheritBefore": true

As shown in https://developers.google.com/sheets/reference/rest/v4/spreadsheets/request#insertdimensionrequest

>All comments

Just solved my own problem, the example is using the wrong field name, it should be

"inheritFromBefore": true

not

"inheritBefore": true

As shown in https://developers.google.com/sheets/reference/rest/v4/spreadsheets/request#insertdimensionrequest

Was this page helpful?
0 / 5 - 0 ratings