Skip to main content
Freeze the selected rows and fields at one cutoff. Use fromSlice to reuse an existing slice’s filter at a new cutoff. Split fields are always frozen. Returns a slice with status creating; poll until ready or failed. Uploads and blocking field operations prevent creation.

Signature

Method signature on client.datasets:

Parameters

Pass one of the argument shapes shown in the signature.
string
required
Dataset ID with prefix ds..
string
A name to tell slices apart, for example “October eval”. Defaults to Slice 1, Slice 2 and so on.
object
Select rows at the slice cutoff. Omit to include all rows. This filter cannot use createdBefore, another slice, or split parts.
string[]
Fields to freeze, by name or ID. Defaults to all fields. Split fields are always frozen; other fields omitted here keep their latest values. Fields, by field name or id, to freeze at the new cutoff. Defaults to the fields the source slice froze.
string
A ready slice of this dataset to take again: the same filter and frozen fields at a new cutoff, so rows added or changed since are picked up.

Returns

Promise<DatasetSlice>
string
required
Slice id. The same id always selects the same rows with the same frozen values.
string
required
ID of the dataset containing this slice, with prefix ds..
string
required
The name that tells this slice apart.
object | null
required
The filter the rows matched when the slice was taken; null for every row.
string[]
required
Fields the slice reads as they were at its cutoff. Other fields read live.
string | null
required
The slice this one was taken from, if any.
"creating" | "ready" | "failed"
required
Only a ready slice can select rows.
number
required
Rows in the slice once it is ready; 0 until then.
object | null
required
Why the slice failed.
string
required
The moment the slice was taken: its rows and its frozen fields are read as they were just before it.
string
required
When the slice was requested.

Errors

HTTP errors throw PotatoApiError. The endpoint documents these error responses: HTTP endpoint: POST /datasets/{datasetId}/slices.