Create a PDF Report from Google Sheets, Analyze It with ChatGPT, and Send Both PDFs by Email Using Zapier and PDF.co
This tutorial explains how to convert a Google Sheets report into PDF, extract its text automatically, analyze the report with ChatGPT, create a second PDF containing the analysis, and send both documents through Gmail.
The completed workflow is:
Google Sheets → PDF.co report PDF → PDF.co text extraction → ChatGPT analysis → PDF.co analysis PDF → Gmail
This produces two useful documents:
- The original report PDF generated from the spreadsheet.
- A separate PDF containing ChatGPT’s analysis.
Requirements
Before starting, make sure you have:
- A Zapier account.
- A PDF.co account and API key.
- An OpenAI account connected to Zapier.
- A Google account connected to Zapier.
- A Gmail account or another supported email service.
- A Google Sheets report containing sample data for testing.
IN THIS TUTORIAL
Step 1: Prepare the Google Sheets Report
Organize the report data in a worksheet with descriptive column headers. Remove unnecessary blank rows and columns, and format the spreadsheet as you want it to appear in the original report PDF.
Before creating the Zap, decide what should initiate the workflow:
- Use New Spreadsheet when each report begins with a newly created spreadsheet.
- Use New or Updated Spreadsheet Row when a report should be generated after data is added or changed.
- Use Schedule by Zapier when reports should be generated daily, weekly, or monthly.
The following steps use New Spreadsheet, matching the original workflow.
Step 2: Configure the Google Sheets Trigger
Create a Zap and select Google Sheets as the trigger app.
Choose New Spreadsheet as the trigger event. Connect your Google account, then select the Google Drive location Zapier should monitor.
Test the trigger. Zapier should return a recently created spreadsheet and its available file, download, or export links.
If Zapier does not find suitable test data, create a sample spreadsheet in the selected drive and test the trigger again.
Step 3: Convert the Spreadsheet into the Original Report PDF
Add PDF.co as the next app and select Anything to PDF Converter.
Connect your PDF.co account using the API key available in your PDF.co dashboard.
Configure the action:
- Input Format: Select the spreadsheet input option that matches the source, such as CSV, XLS, XLSX, or a compatible file-token link.
- Input Source: Map the downloadable file or export link returned by the Google Sheets trigger.
- Output PDF Name: Enter a filename such as
spreadsheet-report.pdf. - Worksheet Index: To convert one worksheet, enter its zero-based index. The first worksheet is
0. Leave the field empty to process all worksheets. - Custom Profiles: Add advanced conversion settings only when needed.
If the Google Sheets trigger supplies only a native spreadsheet link rather than a downloadable file, add a Google Drive Export File action before PDF.co. Export the spreadsheet as XLSX, then map the exported file into PDF.co.
Test the PDF.co action. A successful response should include a temporary URL for the generated report PDF.
Open the URL and verify:
- All expected rows and columns are present.
- The page orientation is appropriate.
- Text is readable.
- Tables are not cut off.
- Page breaks appear in suitable locations.
Keep the output URL from this step. It will be used for text extraction and can also be attached to the final email.
Step 4: Extract Text from the Report PDF
Add another PDF.co action and select PDF to Anything Converter.
This step eliminates the need to open the report manually and copy its text into ChatGPT.
Configure the action:
- Output Format: Select Plain Text.
- Source File URL: Map the report PDF URL returned by the Anything to PDF Converter.
- Page Selection: Leave this empty to extract the complete report, or enter the required zero-based page numbers or ranges.
- Inline Output Option: Set this to True.
- OCR Language: Configure this only if the PDF contains scanned content.
- File Name: Optionally provide a name for the extracted text.
Enabling inline output returns the extracted text directly to Zapier instead of returning only a text-file URL.
Test the action and confirm that the response body contains readable text from the report.
Step 5: Analyze the Report with ChatGPT
Add the ChatGPT (OpenAI) app and select the current Conversation action. Do not select Conversation (Legacy).
Connect your OpenAI account and select one of the currently supported models available in Zapier.
Enter the following instructions:
You are a business-report analyst.
Analyze only the report data provided by the user. Identify important
metrics, trends, changes, outliers, risks, and opportunities. Preserve
important dates, figures, categories, and labels.
Do not invent missing information. If the report does not contain enough
information to support a conclusion, say so clearly.
Return only a simple, valid HTML report. Use headings, paragraphs, tables,
and lists. Do not return Markdown or include code fences.In User Message, enter:
Analyze the following report.
Include:
- An executive summary
- Key metrics
- Important trends
- Unusual or concerning results
- Risks and opportunities
- Recommended follow-up actions
- Any data-quality limitations
Report text:
[Map the inline text returned by the PDF.co extraction step here]Optional: Preserve Customer Context
If this workflow repeatedly analyzes reports for the same customer, enter a stable, customer-specific value in the Memory Key field. This allows the ChatGPT action to retain conversational context between workflow runs and produce analysis informed by earlier interactions.
Use a unique internal customer identifier, such as:
customer-report-[Customer ID]Map the customer ID dynamically when the same Zap serves multiple customers. Avoid using sensitive personal information directly in the Memory Key.
Leave this field blank when each report should be analyzed independently. A Memory Key is also unnecessary for one-time reports or when previous analyses should not influence the current result.
Test the ChatGPT action and review the response carefully. Confirm that all important names, dates, figures, and conclusions agree with the original report.
For reports requiring exact totals, percentages, averages, or financial calculations, calculate those values in Google Sheets before generating the report. Use ChatGPT primarily to interpret and explain the supplied results.
Step 6: Convert the ChatGPT Analysis into PDF
Add another PDF.co action and select HTML to PDF Converter.
In the HTML input, add a document template and map the ChatGPT response into the body:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Report Analysis</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.5;
margin: 40px;
color: #222;
}
h1 {
border-bottom: 2px solid #333;
padding-bottom: 10px;
}
h2 {
margin-top: 28px;
}
table {
width: 100%;
border-collapse: collapse;
margin: 16px 0;
}
th,
td {
border: 1px solid #ccc;
padding: 8px;
text-align: left;
vertical-align: top;
}
th {
background: #f2f2f2;
}
</style>
</head>
<body>
<h1>Report Analysis</h1>
[Map the ChatGPT response here]
</body>
</html>Configure the remaining options:
- Select the desired page orientation.
- Select a page size.
- Configure margins if necessary.
- Enter an output filename such as
report-analysis.pdf.
Test the action. Open the returned PDF URL and check every page for missing content, clipped tables, formatting problems, and inaccurate analysis.
You should now have two PDF URLs:
- The spreadsheet report PDF from Anything to PDF Converter.
- The analysis PDF from HTML to PDF Converter.
Step 7: Send Both PDFs Through Gmail
Add Gmail as the final app and select Send Email.
Configure the email:
- To: Enter or map the recipient’s email address.
- Cc/Bcc: Add additional recipients when required.
- From: Select an available sending address or alias if needed.
- From Name: Optionally enter a recognizable sender name.
- Reply To: Add a reply address if it differs from the sending account.
- Subject: Enter a subject such as
Spreadsheet Report and Analysis. - Body Type: Select Plain or HTML.
- Body: Explain that both the original report and its analysis are attached.
- Attachments: Map both PDF.co output URLs.
Example email body:
Attached are the original spreadsheet report and the accompanying
analysis report.
The analysis was generated automatically and should be reviewed before
being used for consequential business decisions.Test the Gmail action. Confirm that the email arrives with both PDF files attached and that each attachment opens correctly.
Step 8: Store the Generated Reports
PDF.co output URLs are temporary. Gmail retrieves the files when sending the email, but the URLs should not be treated as permanent storage.
If the reports must be retained, add storage actions before the Gmail step. Save both PDFs to Google Drive, Dropbox, OneDrive, Box, or your document-management system.
Consider storing the files with distinct names, such as:
spreadsheet-report.pdfspreadsheet-report-analysis.pdf
You can include a date, customer name, reporting period, or another identifier in each filename.
Step 9: Publish the Zap
Run one final test of the complete workflow and verify that:
- The correct spreadsheet starts the Zap.
- The spreadsheet is converted into a readable PDF.
- Text is extracted automatically.
- ChatGPT receives the extracted report text.
- The analysis accurately reflects the source report.
- The analysis PDF is formatted correctly.
- Both PDFs are attached to the email.
- Permanent copies are stored when required.
Publish the Zap after the complete test succeeds. The workflow will now create the original spreadsheet report PDF, generate a separate analysis PDF, and deliver both documents automatically.
In this tutorial, you created an automated workflow that converts a Google Sheets report into PDF, extracts its text for analysis, and sends the content to ChatGPT without manual copying. You then used PDF.co’s HTML to PDF Converter to create a separate analysis report and Gmail to deliver both PDFs as email attachments.
This workflow preserves the original spreadsheet report while providing an additional AI-generated analysis. It can also be extended to store the reports in Google Drive, Dropbox, OneDrive, or another document-management system for future access.
Related Tutorials

