Forward to Slack or Google Sheets
These are examples you host yourself. FormRoost does not provide native Slack or Google Sheets connectors. Start with either signed receiver. Run forwarding separately so a slow destination does not delay the webhook acknowledgment.
Slack incoming webhook
Create an incoming webhook for your Slack workspace. Store its URL as SLACK_WEBHOOK_URL on the forwarding server. Treat that URL as a secret. Do not use it as the FormRoost webhook destination: Slack does not verify FormRoost signatures or consume its event envelope.
Google Sheets with Apps Script
Create a sheet with columns Event ID, Receipt ID, Email, and Message. In its Apps Script project, set script properties SHEET_ID and FORWARD_TOKEN (a long random secret). Replace Sheet1 below if needed. Deploy as a web app that runs as you and accepts requests from your forwarding server. Keep the deployment URL in SHEETS_WEB_APP_URL, and the same token in SHEETS_FORWARD_TOKEN on that server.
function doPost(e) {
const properties = PropertiesService.getScriptProperties();
const input = JSON.parse(e.postData.contents);
const token = properties.getProperty('FORWARD_TOKEN');
if (!token || input.token !== token) throw new Error('Unauthorized');
const lock = LockService.getScriptLock();
lock.waitLock(10000);
try {
const sheet = SpreadsheetApp.openById(properties.getProperty('SHEET_ID'))
.getSheetByName('Sheet1');
const ids = sheet.getLastRow() > 1
? sheet.getRange(2, 1, sheet.getLastRow() - 1, 1).getValues().flat() : [];
if (!ids.includes(input.id)) {
// Treat visitor values as text, never spreadsheet formulas.
const text = (value) => "'" + String(value ?? '');
sheet.appendRow([input.id, input.receiptId, text(input.email), text(input.message)]);
}
return ContentService.createTextOutput(JSON.stringify({ ok: true }))
.setMimeType(ContentService.MimeType.JSON);
} finally {
lock.releaseLock();
}
}
The lock and event ID check prevent repeated rows in this small-sheet example. A large sheet needs a more efficient deduplication store. The token belongs only in the server-to-script request; never include it in browser submissions.
Forward saved events
Save as forward.mjs next to the Node receiver, or run it against the Python receiver's inbox. Node's built-in fetch is enough. Set INBOX to the same persistent directory. Set one or both destinations. Run node forward.mjs from a scheduler, with only one forwarding process at a time.
import { readdirSync, readFileSync, existsSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
const inbox = process.env.INBOX || './inbox';
const slack = process.env.SLACK_WEBHOOK_URL;
const sheets = process.env.SHEETS_WEB_APP_URL;
if (!slack && !sheets) throw new Error('Configure a destination');
if (sheets && !process.env.SHEETS_FORWARD_TOKEN) throw new Error('Set SHEETS_FORWARD_TOKEN');
async function deliver(file, destination, url, body) {
const marker = `${file}.${destination}.done`;
if (existsSync(marker)) return;
const response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
signal: AbortSignal.timeout(10000),
});
if (!response.ok) throw new Error(`${destination}: HTTP ${response.status}`);
if (destination === 'sheets' && (await response.json()).ok !== true) {
throw new Error('Sheets did not confirm the write');
}
writeFileSync(marker, '', { mode: 0o600, flush: true });
}
for (const name of readdirSync(inbox).filter((name) => name.endsWith('.json'))) {
const file = join(inbox, name);
const event = JSON.parse(readFileSync(file, 'utf8'));
if (event.type !== 'com.formroost.submission.created.v1') continue;
const { receiptId, fields } = event.data;
try {
if (slack) await deliver(file, 'slack', slack, {
text: `New submission ${receiptId}`,
blocks: [{ type: 'section', text: {
type: 'plain_text',
text: `Email: ${String(fields.email ?? '').slice(0, 500)}\nMessage: ${String(fields.message ?? '').slice(0, 2000)}`,
} }],
});
if (sheets) await deliver(file, 'sheets', sheets, {
token: process.env.SHEETS_FORWARD_TOKEN,
id: event.id, receiptId, email: fields.email, message: fields.message,
});
} catch {
console.error(`Forward failed for ${event.id}; retry on the next run`);
process.exitCode = 1;
}
}
This uses only the email and message fields; adapt them to your schema. It sends visitor text to Slack as plain text to avoid interpreting mentions or formatting.
A failed destination has no completion marker and is retried on the next run. Preserve inbox files and completion markers. Slack may receive a duplicate if the process stops after Slack accepts a message but before the marker is saved. The Sheets example deduplicates by event ID. This is not an exactly-once delivery guarantee.
FormRoost sees the receiver's 204, not downstream failures. Monitor this forwarding job and retry locally. Replaying an already saved FormRoost event will not re-run a completed destination. To intentionally forward it again, remove only that destination's completion marker; Sheets will still suppress its existing event ID.