Choose where you’d like to start

Get Sheets from Zoho Sheet

Description

The zoho.sheet.getSheets task is used to fetch a list of all the worksheets from the specified Zoho Sheet file. This task is based on the Zoho Sheet API - List All Worksheets.

Note: On average, it takes about a minute to index a file/folder after it is created or updated. This indexing time can increase if the queue size increases.  You will not get the expected result if you execute zoho.sheet.getSheets task before the Zoho Sheet file you need to fetch is indexed.

Syntax

<response> = zoho.sheet.getSheets(<resource_id>, <connection>);
where:

 

ParamsData typeDescription

<response>

KEY-VALUE

The names and IDs of all the worksheets present in the specified Zoho Sheet file.

<resource_id>

TEXT

The Zoho Sheet file from which a list of worksheets will be fetched.

Note: The resource_id can be obtained from the URL of the Zoho Sheet file. The URL is in the following format:

https://sheet.zoho.com/sheet/open/<resource_id>/sheets/<worksheet_name>
/ranges/<cell_range>

<connection>

TEXT

The link name of the connection.

Note:

  • In view of stopping new authtoken generation, a Zoho OAuth connection with appropriate scopes is mandatory in order for new integration tasks (created after the deadline specified in the post) to work as expected. Existing integration tasks will continue to work with or without the connections parameter until you manually delete the authtoken from accounts.
  • Scopes required for this task as mentioned in API docs - ZohoSheet.dataAPI.UPDATE, ZohoSheet.dataAPI.READ.
  • Refer to this post for the list of Zoho services that support the connections page.
  • Learn more about connections

Example

The following script fetches the list of all the worksheets from the Zoho Sheet file of ID - eev4nXXXXXXXXXXXXXXXXXXXXXXXXXXXcff41.

response = zoho.sheet.getSheets("eev4nXXXXXXXXXXXXXXXXXXXXXXXXXXXcff41", "sheet_connection");

where:

response
The KEY-VALUE response returned by Zoho Sheet. It holds the names and IDs of all the worksheets in the specified Zoho Sheet file.
"eev4nXXXXXXXXXXXXXXXXXXXXXXXXXXXcff41"
The TEXT that represents the ID of the Zoho Sheet file.
"sheet_connection"
The TEXT that represents the link name of the Zoho Sheet connection.

Response Format

Success Response

  • The success response will be returned in the following format:

      {
      "worksheet_names": [
      {
      "worksheet_id": "0#",
      "worksheet_name": "Sheet1"
      },
      {
      "worksheet_id": "1#",
      "worksheet_name": "Sheet2"
      }
      ],
      "method": "worksheet.list",
      "status": "success"
      }

Failure Response

  • The failure response for invalid resource ID  will be returned in the following format:

      {
      "error_message": "Mentioned resource ID is not valid",
      "error_code": 2898
      }

Related Links

Get Started Now

Execute