Get Sheets from Zoho Sheet
Table of Contents
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.
Syntax
<response> = zoho.sheet.getSheets(<resource_id>, <connection>);
Params | Data type | Description |
<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> |
<connection> | TEXT | The link name of the connection. Note:
|
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
"eev4nXXXXXXXXXXXXXXXXXXXXXXXXXXXcff41"
"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
}