Skip to main content

Update Worksheet Data

  • To update data in a worksheet, you need the following 3 parameters:
  • 1.Access Token
  • 2.Worksheet Id
  • 3.App Id

How to get the token

PUT

https://{region}-api.tablesprint.com/api/platform/worksheet/row/{appId}/{worksheetId}

URL Parameters

ParameterTypeRequiredDescription
appIdstringYesThe unique identifier of the application
worksheetIdstringYesThe unique identifier of the worksheet

To get URL parameters follow these steps:

  • 1.Click on the downward arrow beside the worksheet name.
  • 2.A dialog box with options will open. image

  • 3.Click on More Info, and you'll see the worksheetId and AppId. image

Request Body Parameters

ParameterTypeRequiredDescription
columnNamestringyesThe name of the column to be updated.
valuestringyesThe new value to update the column with.
_idstringyesThe unique identifier of the row to be updated.

How to know _id of the row?

  • 1.To retrieve the _id of the rows, request the data using the "Get Worksheet Data" API.
  • 2.Then, for each row, you will receive an _id.

_id of the rows

Example :

  • When you want to update a single row.
{
"data": [
{
"name": "Tablesprint",
"Number": "800",
"_id": "998be891af"
}
]
}

Example 2:

  • When you want to update multiple rows at once, you must know the _id of each row to be updated. You need to provide the data in the request body as objects, separated by commas.
{
"data": [
{
"name": "Table",
"Number": "1200",
"_id": "998be891af"
},
{
"name": "Chair",
"Number": "800",
"_id": "998be891ba"
}
]
}

Request Headers

HeaderValue
AuthorizationBearer YOUR_ACCESS_TOKEN
Content-Typeapplication/json

-Here is the example how to make this request:

curl -L -X PUT 'https://ind-mumbai-api.tablesprint.com/api/platform/worksheet/row/appId/worksheetid' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-d '{
"data": [
{
"columnName1": "Updated Value1",
"columnName2": "Updated Value2",
"_id":"_id of the row1"
},
{
"columnName1": "Updated Value1",
"columnName2": "Updated Value2",
"_id":"_id of the row2"
}
]
}'

Response

A successful request returns the HTTP 200 OK status code and JSON response body.

  • results.updateCount : Represents the number of rows that were updated when upsert is set to true and a matching row already exists.
  • results.insertCount : Represents the number of new rows added when no existing match is found and when upsert is set to true.
  • In case you get other error codes: Refer here
{
"results": {
"updateCount": 3,
"insertCount": 0
},
"success": true
}

Response Headers

HeaderDescription
Content-Typeapplication/json
info

Make sure to select the appropriate region from the dropdown in the UI before sending your request. The request URL depends on the selected region.

Update data playground