Skip to content

Diagnostic reference

GoogleJsonResponseException: valueInputOption is required

Fix GoogleJsonResponseException HTTP 400 valueInputOption required on Sheets.Spreadsheets.Values.update, append, and batchUpdate in Google Apps Script.

Updated December 6, 2026

Apps Script error

GoogleJsonResponseException: API call to sheets.spreadsheets.values.update failed with error: 'valueInputOption' is required but not specified

What it means

The Advanced Sheets API v4 requires valueInputOption on Values.update(), Values.append(), and Values.batchUpdate(). Omitting the options argument sends INPUT_VALUE_OPTION_UNSPECIFIED, which the Sheets REST API rejects with HTTP 400.

Related error messages

  • GoogleJsonResponseException: API call to sheets.spreadsheets.values.append failed with error: 'valueInputOption' is required but not specified
  • GoogleJsonResponseException: API call to sheets.spreadsheets.values.batchUpdate failed with error: Invalid valueInputOption: INPUT_VALUE_OPTION_UNSPECIFIED

Before and after

The code before and after the fix.

Problem 0 changed lines
function writeSummaryRow(spreadsheetId) {
  Sheets.Spreadsheets.Values.update(
    { values: [['Ada', 42]] },
    spreadsheetId,
    'Summary!A2:B2',
  );
}
Fixed 1 changed line
function writeSummaryRow(spreadsheetId) {
  Sheets.Spreadsheets.Values.update(
    { values: [['Ada', 42]] },
    spreadsheetId,
    'Summary!A2:B2',
    { valueInputOption: 'USER_ENTERED' },
  );
}

How to fix it

  • Pass { valueInputOption: 'USER_ENTERED' } as the fourth argument to Values.update() and Values.append() when you want Sheets to parse formulas, dates, and numbers.
  • Pass { valueInputOption: 'RAW' } when writing untrusted text that must stay literal and never evaluate as a formula.
  • For Sheets.Spreadsheets.Values.batchUpdate(), put valueInputOption inside the first request body object alongside data.

Things to check

  • Sheets.Spreadsheets.Values requires enabling the Google Sheets API under Services in the Apps Script editor.
  • myFunction catches missing or unspecified valueInputOption statically under rule MF95032 and offers a quick fix.

In the Apps Script editor

Catch errors like this before clicking Run.

myFunction (published as Error Checker for Google Apps Script on the Chrome Web Store) checks your code while you edit at script.google.com. Diagnostics, autocomplete, and rule-based quick fixes are free without an account, run in your browser, and request no Google Drive, Gmail, or Apps Script project OAuth scopes. Writing Apps Script with an AI coding agent? Connect the Apps Script MCP server to run the same static checks before pasting code.