What is a Google Sheets Writer node?

Node in Stack AI

Google Sheets is a cloud-based spreadsheet application that allows users to create, edit, and share spreadsheets. Users can input data, create formulas, generate charts, and collaborate in real-time. Google Sheets is an excellent tool for organizing data in rows and columns, performing calculations, and analyzing information.

The Google Sheets Writer node allows you to connect with your Google Sheets account and write data directly into your spreadsheets.

How to use it?

Connections to a Google Sheets Writer node

To utilize the Google Sheets Writer node, you need to connect with your account. Click on Connect with Google Sheets to authenticate.

Getting the Google Sheets ID and Sheet Name

To get the Google Sheets ID you need to go to the Google Sheets spreadsheet and inspect the URL. The Google Sheets ID is the part of the URL after https://docs.google.com/spreadsheets/d/ and before the /edit.

The Sheet Name can be found in the bottom left corner of the spreadsheet.

Example of usage

A practical application of the Google Sheets Writer node involves reading an invoice and sending a JSON object generated by an LLM to a Google Sheets spreadsheet.

Sending an invoice to Google Sheets via a Google Sheets Writer node

To construct this workflowm employ an LLM to generate the JSON object. Add a Google Sheets Writer node to the LLM so that results can be sent to Google Sheets.

System prompt (LLM)

You are a helpful AI assistant. You generate a JSON object from an invoice.

The JSON contains the following keys:

- invoice_number: the invoice number
- invoice_date: the invoice date
- invoice_amount: the invoice amount
- invoice_concept: the invoice concept

The JSON object will then be sent to Google Sheets.

Prompt (LLM)

Generate a JSON object with the following keys: invoice_number, invoice_date, invoice_amount, invoice_concept.

Document uploaded by the user: {doc-0}

This will generate the following JSON object:

{
  "invoice_number": "123456",
  "invoice_date": "2024-01-01",
  "invoice_amount": 1000,
  "invoice_concept": "Invoice for services"
}