Contents
Google Sheets integration

Google Sheets push notifications when a sheet changes

PushPiper sends Google Sheets edits to your phone, free for 10,000 messages a month on 10 devices. An installable Apps Script trigger catches each change and runs within Google's daily quotas of 20,000 URL Fetch calls and 90 minutes of trigger runtime on personal accounts.

Setting up your notification endpoint

Before pasting anything into Google Sheets, you need somewhere for the alerts to land. PushPiper runs as a web application that you install straight from your browser on Android, Windows, macOS, and Linux. If you are on an iPhone or iPad running iOS 16.4 or later, open the site in Safari, tap Share, and choose Add to Home Screen.

PushPiper does not have native App Store or Play Store apps yet, and it does not make phone calls, send SMS text messages, or break through iOS Do Not Disturb. It delivers web push notifications directly to your screens through an HTTP API. If you need a simple push route instead of paying carrier fees or setting up complex alert software, it takes less than a minute to configure.

  1. Open PushPiper and sign up free with your Google account. No credit card is required.
  2. Copy your 30-character user key in the app.
  3. Create an application for your spreadsheet notifications and copy the 30-character app token.

Once you have both keys, you can send a push notification to your phone manually with a single HTTP POST request, or hand them off to Apps Script to handle it on every spreadsheet edit.

Adding the script to Google Sheets

Google Sheets allows you to attach custom JavaScript through bound Apps Scripts. This script checks the name of the tab being edited, formats the old and new cell values, and sends a POST request to PushPiper.

  1. Open your spreadsheet in Google Sheets.
  2. In the top navigation menu, open Extensions and click Apps Script.
  3. Clear out any sample code inside Code.gs and paste the script below.
  4. Replace APP_TOKEN with your application token and USER_KEY with your user key.
  5. Update WATCH_SHEET to match the exact name of the tab you want to monitor, such as Orders or Sheet1.
  6. At the top of the editor, choose createTrigger from the function dropdown and click Run.
  7. Approve the authorization prompt with your Google account when asked.
Code.gs
const APP_TOKEN = 'APP_TOKEN';
const USER_KEY = 'USER_KEY';
const WATCH_SHEET = 'Orders';

function notifyEdit(e) {
  const sheet = e.range.getSheet();
  if (sheet.getName() !== WATCH_SHEET) return;

  UrlFetchApp.fetch('https://api.pushpiper.com/1/messages.json', {
    method: 'post',
    payload: {
      token: APP_TOKEN,
      user: USER_KEY,
      title: `${sheet.getName()} ${e.range.getA1Notation()} changed`,
      message: `${e.oldValue ?? '(empty)'} -> ${e.value ?? '(several cells)'}`.slice(0, 1024),
    },
  });
}

function createTrigger() {
  ScriptApp.newTrigger('notifyEdit').forSpreadsheet(SpreadsheetApp.getActive()).onEdit().create();
}

Google Sheets includes simple triggers like a bare onEdit(e) function, but simple triggers cannot make outgoing network calls. Because UrlFetchApp.fetch requires authorization to make web requests, you have to use an installable trigger created via createTrigger.

What arrives in the push alert

When an edit occurs on the sheet specified in WATCH_SHEET, the script catches the event payload and posts the update to the PushPiper API.

The notification title contains the tab name and the cell coordinates in A1 notation, such as Orders B4 changed. The body text compares the previous content with the new entry:

  • If someone edits a cell that already had text, the notification shows Old Value -> New Value.
  • If someone types into a previously blank cell, the script prints (empty) -> New Value.
  • If a user pastes a range of multiple cells or drags a column down, the event object cannot isolate a single value, so the script logs (several cells).

PushPiper rejects any message body longer than 1,024 characters with an HTTP 400 error. The script uses .slice(0, 1024) on the payload string to ensure that large text blocks or formulas get trimmed down instead of failing at the API boundary.

Picking the right trigger type

The standard onEdit trigger only fires when a user manually modifies the value of an existing cell. It does not fire when automated integrations update a row, when new rows get inserted, or when an external form submits data into the sheet.

This table compares the three trigger types you can attach to a Google Sheets document.

TriggerFires whenGood for
onEdit (installable)A person edits a cellStatus columns, approvals
onChange (installable)Rows or columns are inserted or removed, or the structure changesNew rows
onFormSubmit (installable)A linked Google Form is submittedForm responses

If your spreadsheet receives submissions from an attached Google Form, an onEdit trigger will ignore them. Use onFormSubmit instead so the notification triggers as each response arrives. We have a separate walkthrough for Google Forms push notifications if you need to inspect raw form responses.

If you care about structural updates, such as a teammate adding a new column or inserting ten blank rows at once, create an onChange trigger instead. You register it in Apps Script with .forSpreadsheet(SpreadsheetApp.getActive()).onChange().create().

Trigger runtime and Google quotas

Apps Script triggers run inside Google's infrastructure, which enforces daily usage quotas on all accounts. Every cell edit on your sheet triggers an execution, so watching an entire workbook with heavy editing activity can drain your allowances fast.

Keep these operational boundaries in mind:

  • Personal gmail.com accounts are limited to 20,000 URL Fetch calls a day, while paid Google Workspace accounts receive 100,000 calls.
  • Total trigger runtime across all scripts in a Google account cannot exceed 90 minutes per day.
  • A single script execution has a hard timeout of 6 minutes.
  • PushPiper limits apps to 600 requests a minute per app token, and free accounts include 10,000 messages per month before resetting on the 1st at 00:00 UTC.

Filtering by sheet name in notifyEdit is what keeps this setup sustainable. Without that guard clause, every minor edit across every secondary sheet tab would send an unnecessary HTTP request and waste your daily execution quota.

Sources

Questions and answers

Why did createTrigger require permission approval?

Installable triggers need explicit permission to access your spreadsheet and make outgoing web requests over the internet. Approving the prompt allows UrlFetchApp to communicate with external endpoints using your Google account identity.

Can I alert multiple team members when a cell changes?

Yes. You can pass up to 50 comma-separated user keys in the user parameter, or enter a PushPiper group key to broadcast the notification to all group members simultaneously.

Why does my notification say several cells instead of the value?

Google Apps Script only includes the old and new cell values in the edit event when a single cell is modified. When someone pastes a block of data or drags across a range, Google omits the single-cell values.

Will this script notify me if an automated API script updates the sheet?

No. Google Sheets edit triggers only run in response to human edits made inside the Google Sheets interface. Changes pushed by external scripts, macros, or API calls will not activate an onEdit trigger.