Spreadsheet meta
Meta information is data attached to a cell and hidden from the user.
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, the cell's meta information is removed. |
POST /api/:guid/:worksheetIndex/meta
deleteMeta
Remove meta information.
| Parameter | Description |
|---|---|
cellNames |
Cell names and/or ranges. If null or omitted, meta information is removed from all cells. |
DELETE /api/:guid/:worksheetIndex/meta/:cellNames
Examples
Read the meta information
All cells:
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);
One 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
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
Reset the meta information of all cells.
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,
});