New commands Google Sheet

There are some certain limitations in Google sheet integration. It would be great if you could:

  1. Add a blank sheet in existing spreadsheet
  2. Rename sheet

The problem I face is that I have a spreadsheet with every weeks data that I share internally.
Copying the template into the spreadsheet makes an ' Copy of template' sheet at the end of the sheets... 80th position and raising every week..

1 Like

Hi @p.siontoros :wave: thanks for reaching out with this!

As you observed, there's currently no method that supports updating a sheet name within the native Google Sheets integration. That said, if it suits your use case, you could consider calling the relevant Google Sheet API endpoint via a REST API resource to make the necessary updates.

I hope this helps! Let us know if you have any other questions too though 😄

+1ing this request after chatting with support, i can create a new spreadsheet but not being able to create new sheets/rename them within would be useful to have without resorting to the rest api.

1 Like

For posterity, this took awhile to get set up right for me, so to get this working i took the following steps, some might be unnecessary or redundant:

  1. Go to google cloud platform dashboard, go to credentials, and set my app in the url (https://{{orgurl}}.retool.com) and in the authorized redirect URIs, i ended up adding a bunch, i'm not sure which one is needed, https://{{orgurl}}.retool.com/oauth/oauthcallback, https://{{orgurl}}.retool.com/oauthcallback, https://oauth.retool.com/oauth/oauthcallback, https://oauth.retool.com/oauth/oauthcallback, https://oauth.tryretool.com/oauth/oauthcallback.
    a) then go to the library page, and add Google Sheets APi, Google Drive Api, Google+api
  2. Create a Rest API resource
    Set Headers to keys Authorization: Bearer OAUTH2_Token
    Set Authentication to OAuth 2.0
    auth url to Sign in - Google Accounts
    Auth token url to https://www.googleapis.com/oauth2/v4/token
    client id to the client ID from your google credentials above
    client secret from the google credentials above
    scope: profile openid https://www.googleapis.com/auth/spreadsheets
  1. make a resource query using your api resource
    Action type POST, url https://sheets.googleapis.com/v4/spreadsheets/{{sheet_id_query.value}}:batchUpdate
    body raw:
    {"requests": [
    {
    "addSheet": {
    "properties": {
    "title": "{{get_tab_name.value}}",
    "gridProperties": {
    "rowCount": 20,
    "columnCount": 6
    }
    }
    }
    }
    ]
    }