Spreadsheet cells

The cells methods allows the developer to perform read and write cell operations in their online spreadsheets.

Documentation

The following methods are available to interact with the spreadsheet cells programmatically.

getData

Get the data from the spreadsheet

GET /api/:guid/:worksheetIndex/data

setData

Set a new data for your spreadsheet

Parameter Description
{array} new data

POST /api/:guid/:worksheetIndex/data

Cell values

Update a cell value

const baseUrl = 'https://your-server.example.com/api';
const token = 'MSxlMjE2MWI5YWNjYTg2MzM4MThmN2Y4NjY0YmQzYzBlOGExMmVkZjVk';
const guid = '79b45919-c751-4e2b-a49a-6c1286e2fc03';
const headers = { 'Authorization': `Bearer ${token}` };

// Set a new value on cell C4 (x: 2, y: 3) of worksheet 0
await fetch(`${baseUrl}/${guid}/0/value`, {
    method: 'POST',
    headers,
    body: new URLSearchParams({
        'data[0][x]': '2',
        'data[0][y]': '3',
        'data[0][value]': 'New value',
    }),
});

Retrieve cell values

You can request the data in a spreadsheet by defining a single cell, an array of cells or a range of cells, as below:

Get values from cells

It is possible to retrieve the value from one or multiple cells in a single request.

const baseUrl = 'https://your-server.example.com/api';
const token = 'MSxlMjE2MWI5YWNjYTg2MzM4MThmN2Y4NjY0YmQzYzBlOGExMmVkZjVk';
const guid = '79b45919-c751-4e2b-a49a-6c1286e2fc03';
const headers = { 'Authorization': `Bearer ${token}` };

// Get the values from cells C4, D4 and D5 of worksheet 0
const values = await (await fetch(`${baseUrl}/${guid}/0/value/C4,D4,D5`, { headers })).json();
console.log(values);

// [
//     {
//         x: 2,
//         y: 3,
//         name: "C4",
//         value: "C4",
//     },
//     {
//         x: 3,
//         y: 3,
//         name: "D4",
//         value: null,
//     },
//     {
//         x: 3,
//         y: 4,
//         name: "D5",
//         value: null,
//     },
// ]

Read the data from multiple cells by range

const baseUrl = 'https://your-server.example.com/api';
const token = 'MSxlMjE2MWI5YWNjYTg2MzM4MThmN2Y4NjY0YmQzYzBlOGExMmVkZjVk';
const guid = '79b45919-c751-4e2b-a49a-6c1286e2fc03';
const headers = { 'Authorization': `Bearer ${token}` };

// Get the values from the range C1:C2 of worksheet 0
const values = await (await fetch(`${baseUrl}/${guid}/0/value/C1:C2`, { headers })).json();
console.log(values);

// [
//     {
//         x: 2,
//         y: 0,
//         name: "C1",
//         value: null,
//     },
//     {
//         x: 2,
//         y: 1,
//         name: "C2",
//         value: null,
//     },
// ]