1. Home
  2. Guides
  3. Google Workspace
  4. How to generate PDF invoices from Google Sheets and email them automatically
Google Workspace

How to generate PDF invoices from Google Sheets and email them automatically

Build a no-code automation that reads sales rows from Google Sheets, fills a Google Docs invoice template for each customer, converts it to PDF, emails it through Gmail and saves a copy in Google Drive.

  • By Nur Islam
  • 16:04 video
  • 13 steps
  • 17.6K views
Jump to a step (13)
Who this is for

Small businesses that track sales in a spreadsheet often create each invoice by hand: copy the customer details into a template, export a PDF, attach it to an email and send it. With ten or more customers a month that is an hour of repetitive work and an easy place to make mistakes.

The automation runs in UiPath Studio Web, which works in the browser and is free to start. It loops through every row in your Google Sheet, makes a copy of your Google Docs invoice template, replaces the placeholders with that row's data, downloads the copy as a PDF, and attaches it to a personalized Gmail message.

You can also skip the email and just generate the PDFs into a Google Drive folder. The same idea works with Excel Online and Outlook if your business runs on Microsoft 365.

What you need

  • A Google account with Google Sheets, Google Docs, Google Drive and Gmail
  • A free UiPath Studio Web account
  • A Google Sheet of sales data with columns such as Customer Name, Customer Email, service and price columns, Invoice Number, Invoice Date, Due Date and Total
  • An invoice template in Google Docs with placeholders in double curly brackets, such as {{Customer Name}}

Step by step

0 of 13 done
  1. 01

    Prepare the sales data in Google Sheets

    Put one customer per row. The sheet in the video has the customer name, email, service names and prices (some left blank), an invoice number, invoice date, due date and a total column. Your data can be in a different layout. You only need a column for every value that should appear on the invoice.

  2. 02

    Create the invoice template in Google Docs

    Design the invoice however you like in Google Docs. Wherever a value from the sheet should appear, type a placeholder inside double curly brackets, for example {{Invoice Number}}, {{Invoice Date}} and {{Customer Name}}. Use a table for the services and prices.

    Keep each placeholder name the same as its column name in the sheet. That makes the mapping step later much easier. The curly brackets are the marker the automation uses to find each field.

  3. 03

    Sign up for UiPath Studio Web

    Search for UiPath Studio Web and select Try Studio Web. Sign up with your Google account, then create an organization by entering a display name, country and state and an organization name. Nothing needs to be installed on your computer.

  4. 04

    Create a new project

    Open the Automations tab and create a new project. Pick the manual trigger, because you will run this automation only when you need to send invoices. Rename the project, for example Send PDF invoices from Google Sheets.

  5. 05

    Read the Google Sheet rows in a loop

    Select the plus icon, search for Google Sheets and add For Each Row in Spreadsheet from Google Workspace. Select Connect to Google Sheets, choose your account and allow access.

    Pick the spreadsheet (in the video, Sales Data under My Drive). In the range box type the sheet name, an exclamation mark and the cell range, for example Sheet1!A1:K11. The activity checks that the range is valid. Leave Has headers set to True.

    Every activity from here on goes inside this loop, so it runs once per row.

  6. 06

    Copy the template for each customer

    Inside the loop, add Copy File and connect Google Drive. For the file, browse My Drive and select your invoice template. For the destination, create a folder such as Invoices and select it.

    In the New name box, select Customer Name from For Each Row in Spreadsheet. Each copy is then named after the customer.

  7. 07

    Fill the template with the row's data

    Add Fill Document Template from Google Workspace and connect Google Docs. For the document, open the options menu, choose Use variable and pick the copied file from the Copy File activity.

    Under the document fields, select Add for each placeholder. The key must match the placeholder text in the template exactly, for example Customer Name. For the value, press Ctrl + Space and pick the matching column from For Each Row in Spreadsheet. Repeat for invoice number, customer email, services, prices, dates and total. Keeping the keys in a text file and pasting them avoids typos.

    Under Show additional properties you can see the placeholder symbol. It must match the brackets you used in the template.

  8. 08

    Convert the filled invoice to PDF

    Add Download File from Google Workspace. For the file, choose Use variable and pick the copied file again. Because the fill step already ran, this file now contains the customer's data.

    Under the additional properties, set the Google Docs download format to PDF. The file is downloaded into the automation for the next step, not to your computer. PDF means the customer cannot edit the invoice.

  9. 09

    Email the PDF invoice with Gmail

    Add Send Email for Google Workspace and connect Gmail. Set To to the Customer Email column from the loop. You can add a fixed CC address with the Open expression editor option if you need one.

    Type or paste a subject and replace its placeholders with the Invoice Number and Due Date columns. Paste your email text into the body and insert Customer Name, Invoice Number, Total and Due Date from the loop. You can bold the total and due date.

    Under Attachments, select the file variable from Download File. Other providers such as Outlook are also available if you do not use Gmail.

  10. 10

    Save a copy of each PDF in Google Drive

    Add Upload Files from Google Workspace. For the file, select the downloaded file variable. For the folder, create and select a folder such as PDF Invoices.

    If you only want to generate invoices without emailing them, keep this activity and delete Send Email.

  11. 11

    Test the automation and switch off drafts

    Select Test. UiPath builds the project and runs the activities row by row. Check the PDF Invoices folder and your Gmail.

    On the first run in the video the emails landed in Drafts, not Sent. That is because Send Email saves as a draft by default. Set the draft option to False, delete the drafts and run again. The second run sends ten emails with ten different PDF invoices.

  12. 12

    Publish the automation and run it later

    When testing is done, select Publish and confirm. Next time, open the Orchestrator menu in the UiPath dashboard, go to the Automations tab, select the process and choose Start a job.

  13. 13

    Clean up the working copies

    The Invoices folder holds the filled Google Docs copies the automation made along the way. You can delete them once the run is complete. The final PDFs stay in the PDF Invoices folder.

Tips and common problems

  • Send Email saves messages as drafts by default. Set the draft option to False if you want the invoices sent immediately.
  • The keys in Fill Document Template must match the placeholders in the Google Docs template exactly, including the symbol. One typo leaves that placeholder unfilled.
  • Add every activity inside the For Each Row in Spreadsheet loop, not below it, or it will not run for each customer.
  • Set the sheet range to cover your data. Extra blank rows in the range are fine because the automation skips them.
  • Delete the Google Docs copies in the working folder after each run so old invoices do not pile up next to the PDFs.
Still stuck? Ask AI to help you fix itChatGPTClaudeGeminiCopilotPerplexityGrok

Prefer Microsoft 365?

If you work in Excel and Outlook, see the mail merge with individual attachments tutorial built with Power Automate: watch it here.

Questions

How do I create PDF invoices from Google Sheets automatically?

Make a Google Docs invoice template with placeholders, then use an automation (UiPath Studio Web in this video) that loops through each sheet row, copies and fills the template, and downloads it as a PDF.

Can I generate the PDF invoices without emailing them?

Yes. Remove the Send Email activity and keep Upload Files, which saves each PDF into a Google Drive folder.

Is UiPath Studio Web free?

The video uses a free UiPath Studio Web account. It runs in the browser, so there is nothing to install.

Does this work with Excel and Outlook instead of Google Sheets and Gmail?

Yes. The video notes that the same process works with Excel Online and Microsoft Outlook. You swap the Google activities for their Microsoft equivalents.

Video chapters
Ask a question in the comments Last checked 26 Sep 2026. Screens change: if a step looks different, tell me in the comments.