class SpreadsheetApp method .setValue()

SpreadsheetApp is the Apps Script service.

.setValue() is the method name you will see after a dot in your code.

What it does

Writes a value into a single cell.

Why it's used

  • Write a timestamp, status, or result into one cell.
  • Stamp last run or an error message in a control cell.

Common errors

  • Forgetting parentheses on setValue. Write SpreadsheetApp.setValue(), not SpreadsheetApp.setValue or setValue by itself.
  • Skipping dots between chained calls. Each step needs a dot, like SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data').setValue().
  • Adding spaces where they do not belong. Write SpreadsheetApp.setValue(), not SpreadsheetApp .setValue(), SpreadsheetApp.setValue (), or SpreadsheetApp . setValue().
  • Wrong capitalization. Use SpreadsheetApp and setValue, not spreadsheetapp or setvalue.

Explore

Related methods

10 Better Sheets tutorials

2 New Ways To Add Emoji Reactions

2 New Ways To Add Emoji Reactions

 Revolutionize the way you react with emojis! Discover two new methods t...
Add A Timestamp to Task Lists (without Now Formula)

Add A Timestamp to Task Lists (without Now Formula)

How to add a timestamp to done tasks. Learn how to easily add timestamps...
Add Click Tracking To Your Google Sheets | Bitly in a Google Sheet

Add Click Tracking To Your Google Sheets | Bitly in a Google Sheet

Create a click Edit: Google changed how the redirect is handled. It no l...
Add NPS to Your Google Site

Add NPS to Your Google Site

Create buttons on your Google Site to get an NPS, or Net Promoter Score ...
Add Tasks to Google Tasks From Google Sheets

Add Tasks to Google Tasks From Google Sheets

Create tasks in Google Tasks from Google Sheets using Apps Script
Automate Emails

Automate Emails

Set up automated email notifications based on Google Sheets data. Super ...
Automate Form Response to Confirmation Email

Automate Form Response to Confirmation Email

Create an email automatically when someone fills out a google form. incl...
Automate Help Desk Ticket Closing

Automate Help Desk Ticket Closing

Create a simple automated help desk ticketing system. • Create tickets C...
Automatically Copy Spreadsheet Tab to New File with Values Only, No Formulas

Automatically Copy Spreadsheet Tab to New File with Values Only, No Formulas

Automatically copy a spreadsheet tab to a whole new spreadsheet file, ge...
Automatic Calculations

Automatic Calculations

Create custom scripts to make your spreadsheets more like tools.

Related blog posts

Written guides about SpreadsheetApp.setValue().

Browse the blog