Spreadsheet meta
Meta information are a useful tool to keep information from a cell hidden from the user. Manage the cell meta information of your online spreadsheets using the following routes.
Documentation
getMeta
Get the meta information of a cell.
| Parameter | Description |
|---|---|
cellNames |
Cell names and/or ranges. |
GET /api/:guid/:worksheetIndex/meta/:cellNames
setMeta
Add meta information to the spreadsheet cells.
| Parameter | Description |
|---|---|
metas[].cellName |
Reference cell. |
metas[].value |
Cell meta information. If null or omitted, remove current meta information from cell. |
POST /api/:guid/:worksheetIndex/meta
deleteMeta
Remove meta information.
| Parameter | Description |
|---|---|
cellNames |
Cell names and/or ranges. If null or omitted, remove meta information from all cells. |
DELETE /api/:guid/:worksheetIndex/meta/:cellNames
Examples
Read the meta information
Get all meta information from a spreadsheet
const baseUrl = 'https://your-server.example.com/api';
const guid = '79b45919-c751-4e2b-a49a-6c1286e2fc03';
const headers = { 'Authorization': `Bearer ${token}` };
// Get all meta information
const metas = await (await fetch(`${baseUrl}/${guid}/0/meta`, { headers })).json();
console.log(metas);
Get the meta information from a cell
const baseUrl = 'https://your-server.example.com/api';
const guid = '79b45919-c751-4e2b-a49a-6c1286e2fc03';
const headers = { 'Authorization': `Bearer ${token}` };
// Get the meta information from A1 - use A1,A2,A3 or A1:A3 for multiple cells
const metas = await (await fetch(`${baseUrl}/${guid}/0/meta/A1`, { headers })).json();
console.log(metas);
Add meta information
Meta information are hidden information related to the cells in your spreadsheet.
const baseUrl = 'https://your-server.example.com/api';
const guid = '79b45919-c751-4e2b-a49a-6c1286e2fc03';
const headers = { 'Authorization': `Bearer ${token}` };
// Update meta information
await fetch(`${baseUrl}/${guid}/0/meta`, {
method: 'POST',
headers,
body: new URLSearchParams({
'metas[0][cellName]': 'B2',
'metas[0][value][key]': 'value',
'metas[1][cellName]': 'D4',
'metas[1][value][key2]': 'value 2',
}),
});
Reset the meta information
The following code will reset the meta information of the whole table.
const baseUrl = 'https://your-server.example.com/api';
const guid = '79b45919-c751-4e2b-a49a-6c1286e2fc03';
const headers = { 'Authorization': `Bearer ${token}` };
// Reset the meta information from all cells
await fetch(`${baseUrl}/${guid}/0/meta`, {
method: 'DELETE',
headers,
});