Quick Overview
This workflow collects a Google Sheet ID and export preferences via an n8n Form, reads the selected tab from Google Sheets, converts the rows to CSV or Excel (XLSX), and sends the generated file as a Gmail attachment to the requester.
How it works
- Receives a request through an n8n Form that asks for an email address, Google Sheet ID, optional tab name, export format (CSV or XLSX), and an optional file name.
- Reads the rows from the specified Google Sheets document and tab.
- Validates the email and Sheet ID, checks that the sheet contains data, and attaches export metadata (format, filename, MIME type, row count) to the items.
- Routes the run based on the selected format to generate either an XLSX file or a CSV file.
- Sends an email via Gmail to the provided address with the exported file attached.
Setup
- Connect a Google Sheets OAuth2 credential with access to the spreadsheets you want to export.
- Connect a Gmail OAuth2 credential for the account that sends the export emails.
- Activate the workflow and share the form URL, then ensure requesters provide the correct Sheet ID and (if used) the exact tab name.