Skip to content

Google Sheets — Get sheet names

Type: googlesheets-get-sheet-names  ·  Package: Google Sheets Activities v1.0.5  ·  Output: List<string>

Returns the list of sheet names in the document. Useful when you do not know their names in advance, to check that a sheet exists before using it, or to process every sheet in a loop.

Asks Google for the tab names of the document opened in the session and returns them in tab order. It only reads the names, not the data, so it is a light call.

None.

ParameterTypeDefaultDescription
sessionZoanGoogleSheetsSession—Session from Google Sheets — Open. Inside Open’s body it is inherited and you can leave it empty.

Returns a List of string with the sheet names, in tab order (the first one is what the other activities use when sheet is empty).

MessageCause and fix
No Google Sheets session available. Provide 'session' from a googlesheets-open activity, or place this activity inside the Open activity's body …The activity is outside Open’s body and received no session. Move it inside the body or pass the saved session.
The service sheets has thrown an exception. HttpStatusCode is …Google rejected the call: missing sheet or range, no access, expired token or quota exceeded. See Google API errors.
Google Sheets — Get sheet names session = book → output: names
For Each items = names itemVariable = s
└─ activities:
Google Sheets — Read sheet session = book sheet = s has-headers = true → output: data
Log message = s + ": " + rowCount(data) + " rows"