ACTIONS
  • Home
  • My Actions
  • My Projects
  • My Packages
Google Sheets -> Create Spreadsheet
Readonly
Creates a new Google Spreadsheet using the Sheets API.

Action summary

Google Sheets -> Create Spreadsheet

Xano / Google Sheets

Creates a new Google Spreadsheet using the Sheets API.

Inputs

Name Type Required Description
title text Yes The title of the new spreadsheet.
access_token text Yes Google OAuth2 Access Token for authentication. Install the template here

Function Stack

  1. Build Properties
    • Constructs the spreadsheet properties object (currently only title).
  2. API Request
    • Calls the Google Sheets API to create a new spreadsheet.
    • Endpoint:
      POST https://sheets.googleapis.com/v4/spreadsheets
    • Payload:
      {
        "properties": {
          "title": "My Spreadsheet"
        }
      }
      
    • Authenticates using the provided access token.
  3. Precondition
    • Checks for a successful (status 200) response.
    • Throws an error if the API response is not successful.
  4. Extract Spreadsheet ID
    • Parses the API response for the new spreadsheet's ID.
  5. Extract Spreadsheet URL
    • Parses the API response for the new spreadsheet's URL.

Response

Returns:

{
  "spreadsheet_id": "1A2B3C4D5E",
  "spreadsheet_url": "https://docs.google.com/spreadsheets/d/1A2B3C4D5E/edit"
}

Example Usage

Request

{
  "title": "Team Roster",
  "access_token": "ya29.a0AfH6SMB..."
}

Response

{
  "spreadsheet_id": "1A2B3C4D5E",
  "spreadsheet_url": "https://docs.google.com/spreadsheets/d/1A2B3C4D5E/edit"
}

Notes

  • The spreadsheet title must be unique within your Google Drive.
  • The access token must have permission to create spreadsheets.

References

  • Google Sheets API: Create Spreadsheet
  • Google Sheets API: Concepts
  • Google Sheets API: Reference

Troubleshooting

  • PERMISSION_DENIED: Check your access token and Google account permissions.
  • INVALID_ARGUMENT: Ensure all required fields are provided and valid.
  • For more help: Refer to the Google Sheets API documentation.

Version notes

2025-09-18 17:36:02
Current
2025-09-18T22:37:42.000+00:00