Do you want to automatically collect incoming SMS messages in a Google Sheet for easier tracking, reporting, or analysis? With AutoForwardText, you can forward all your incoming messages to a Google Apps Script web app, which logs them in Google Sheets — no complex servers needed.
This guide will show you exactly how to set it up step by step.
Why Forward SMS to Google Sheets?
- Centralized record keeping: Keep all your messages in one place.
- Automated workflows: Combine Google Sheets with formulas, filters, or dashboards.
- Easy sharing: Share SMS logs with team members instantly.
- Data analysis: Track message patterns, response times, or customer interactions.
What You’ll Need
- AutoForwardText is installed on your iPhone or Android phone — this will forward incoming SMS messages to a Google Apps Script endpoint.
- A Google account and a Google Sheet to store your messages.
- Basic familiarity with Google Apps Script (don’t worry — we’ll guide you step by step).
Step 1: Create a Google Sheet
- Open Google Sheets and create a new spreadsheet.
- Name it something like SMS Logs.
- Add a header row with the following columns:
Timestamp | From | Body | RawPayload
This will store the message time, sender, message body, and full payload for debugging.
Copy the Spreadsheet ID from the URL (the long string between /d/
and /edit
) — you’ll need it.

Step 2: Open Google Apps Script
- In your spreadsheet, go to Extensions → Apps Script.
- This opens the Apps Script editor, where we’ll write a small script to receive SMS messages from AutoForwardText and log them in the sheet.

Step 3: Add the Webhook Script
Paste the following code into the editor. Replace YOUR_SHEET_ID_HERE
with the Sheet ID from your spreadsheet URL:
const SHEET_ID = 'YOUR_SHEET_ID_HERE';
const SHEET_NAME = 'Sheet1';
function _getSheet() {
return SpreadsheetApp.openById(SHEET_ID).getSheetByName(SHEET_NAME);
}
// GET endpoint for testing
function doGet(e) {
return ContentService.createTextOutput(JSON.stringify({ status: 'ready', timestamp: new Date().toISOString() }))
.setMimeType(ContentService.MimeType.JSON);
}
// POST endpoint to receive SMS from AutoForwardText
function doPost(e) {
try {
let payload = {};
if (e.postData && e.postData.type && e.postData.type.includes('json')) {
payload = JSON.parse(e.postData.contents || '{}');
} else {
payload = e.parameter || {};
}
const from = payload.PhoneNumber || payload.from || '';
const body = payload.Content || payload.body || '';
const sheet = _getSheet();
sheet.appendRow([new Date().toISOString(), from, body, JSON.stringify(payload)]);
return ContentService.createTextOutput(JSON.stringify({ status: 'ok' }))
.setMimeType(ContentService.MimeType.JSON);
} catch (err) {
Logger.log(err);
return ContentService.createTextOutput(JSON.stringify({ status: 'error', message: err.message }))
.setMimeType(ContentService.MimeType.JSON);
}
}
Why this works:
- Accepts both JSON and form-encoded POST requests.
- Logs timestamp, sender, message body, and full payload.
- Captures errors for easy debugging.

Step 4: Deploy as a Web App
- Click Deploy → New deployment → Web app.
- Set:
- Execute as: Me
- Who has access: Anyone
- Copy the
/exec
URL — this will be the webhook endpoint for AutoForwardText.






⚠️ Only the
/exec
URL works for webhooks; the/dev
URL will not work.Ignore the warnings related to app access.

Step 5: Configure AutoForwardText
- Log in to the AutoForwardText.com online dashboard.
- Go to Forwarding settings → Webhook/HTTP Forwarding.
- Paste the Apps Script
/exec
URL as the endpoint. - Enable all the fields.
- Save and enable forwarding.

Now, every incoming SMS on your phone will be automatically sent to your Google Sheet.
Step 6: Test Your Setup
- Send a test SMS to your phone.
- Check your Google Sheet — a new row should appear with timestamp, sender, and message.
Optional: You can also test with curl
:
curl -X POST 'YOUR_EXEC_URL_HERE' -d 'From=+1234567890' -d 'Body=Test message'
If you need assistance, please get in touch with our help desk.
Conclusion
Forwarding SMS to Google Sheets using AutoForwardText and Google Apps Script is simple, reliable, and fully automated. Once set up, every incoming message is logged in real time, giving you a central repository for analysis, reporting, or business workflows.
This setup turns your Android phone into a smart, automated SMS logger — freeing you from manually tracking important messages.
Stop losing messages — log them automatically
Use AutoForwardText to forward incoming SMS straight to Google Sheets (or any webhook). Quick setup, reliable delivery, and full control over your data.
- ✔️ Forward texts to Google Sheets, webhooks, or email
- ✔️ Supports JSON & form payloads (perfect for Google Apps Script)
- ✔️ Lightweight, battery-friendly Android forwarding
By signing up you agree to our Terms and Privacy Policy.