Feishu Sheets

In this section, we will learn how to use the Feishu Sheets block.

Use Cases

The Feishu Sheets block allows you to easily read and write data to and from Feishu Sheets. For example, you can scrape product lists from Amazon and write the data into a specified spreadsheet.

example

How Does It Work?

You need to share your sheet so Tapicker can access it.

share-sheet

Spreadsheet ID

You can find the Spreadsheet ID in the URL of your sheet. Follow these steps:

Step 1

Click the "Share" menu.

find-spreadsheet-id-01

Step 2

Click the "Copy link" button and you will get a link like this.

https://xxx.feishu.cn/sheets/IY1jsmQQgh10dwtC6OdcYL6snBb?from=from_copylink

The "IY1jsmQQgh10dwtC6OdcYL6snBb" is the Spreadsheet ID.

💡 Note:
The ID after "/wiki/xxx" is not a Spreadsheet ID, it must be "/sheets/xxx".

Range

Unlike Google Sheets, Rang requires the use of sheetId, not sheetName.

<sheetId>!<start>:<end>

Refer to Fieshu documentation for specifying ranges.

How to find the sheet id?

You can switch different sheets, and then sheet=<sheetId> will appear on the URL.

find-sheet-id

In this example, "4378f9" is the sheetId.

Read a Sheet

Assume the content of the spreadsheet is as follows:

sheet-example

If you want to read the entire sheet, set Range to Sheet1. You will get the following data:

[
  ["Name", "Age"],
  ["Anna", "18"],
  ["Ben", "19"]
]

If you want to read only a part of the data, set Range to Sheet1!A1:B2. You will get:

[
  ["Name", "Age"],
  ["Anna", "18"]
]

With header conversion enabled (enabled by default), you will get:

[
  { "Name": "Anna", "Age": "18" },
  { "Name": "Ben", "Age": "19" }
]

Write a Sheet

You can write data into Values. Two formats are supported for writing data:

1. 2D Array

[
  ["Name", "Age"],
  ["Anna", "18"],
  ["Ben", "19"]
]

2. Array of Objects

[
  { "Name": "Anna", "Age": "18" },
  { "Name": "Ben", "Age": "19" }
]

The array of objects will be converted into a 2D array:

[
  ["Anna", "18"],
  ["Ben", "19"]
]

When you enable the Include Header option, it will add the object keys as headers in the first row:

[
  ["Name", "Age"],
  ["Anna", "18"],
  ["Ben", "19"]
]

3. Write Extracted Data

The extracted data is stored in memory as an array of objects. You can write it directly to Feishu Sheets using Template Syntax:

{{@tables.T208.$rows}}