Stein Docs

Stein Docs

  • Docs
  • GitHub

›Getting Started

Getting Started

  • Introduction & Core Concepts
  • Create an API
  • Read Data from Sheet
  • Search for Data
  • Add Rows to Sheet
  • Update Rows
  • Delete Rows
  • Authentication
  • Using Client Libraries

Hosting

  • Introduction
  • Manual Installation & Setup

Stein Expedite

  • Introduction
  • Installation
  • Display Data from Sheet
  • Search for Data
  • Connect HTML Forms to Sheet

Delete Rows

You can delete specified rows from your sheet. Perform a DELETE request with the row identifiers.

Structuring the JSON

Create a JSON string with the key condition and optionally limit.

{
 "condition": {"column": "value", ...},
 "limit": INTEGER (optional)
}

The value of the condition property is used to search for matching rows in the sheet. It behaves similar to the search param when searching for rows.

These matched rows are then deleted.

The number of rows deleted is limited as per the limit option, if specified.

Performing the request

Let's delete all posts by Shiven Sinha in the Blog Posts Sheet. This request accomplishes that.

cURL
Node.js
HTML
$ curl "https://api.steinhq.com/v1/storages/5cc158079ec99a2f484dcb40/Sheet1" \
-X DELETE \
-H "Content-Type: application/json" \
-d '{"condition": {"author": "Shiven Sinha"}}'
const SteinStore = require("stein-js-client");
const store = new SteinStore(
"https://api.steinhq.com/v1/storages/5cc158079ec99a2f484dcb40"
);

store
.delete("Sheet1", {
search: { author: "Shiven Sinha" }
})
.then(res => {
console.log(res);
});
<script src="https://unpkg.com/stein-js-client"></script>
<script>
const store = new SteinStore(
"https://api.steinhq.com/v1/storages/5cc158079ec99a2f484dcb40"
);

store
.delete("Sheet1", {
search: { author: "Shiven Sinha" }
})
.then(res => {
console.log(res);
});
</script>

Return value

The number of rows deleted is returned as JSON. For example,

{ "clearedRowsCount": 1 }
← Update RowsAuthentication →
  • Structuring the JSON
  • Performing the request
  • Return value
Stein Logo
DocumentationOpen SourcePricingPartners

Privacy PolicyTerms of Service
© 2021 Stein