Delete Rows#

Delete one or multiple rows in a datatable. Rows can be identified by row_ids or with a filter.

Endpoint#
 POST https://api.cloudplan.net/api/tables/delete_rows

Request Parameters#

Possible request parameters#
{
    "table_id": "",
    "row_ids": [],
    "filter": {},
    "admin": false,
    "sub_table_cx": "",
    "sub_table_parent_row_id": ""
}

table_id | (string)

Id of the table to use. If rows should be deleted from a sub-table this would be the id of the main/parent table.

row_ids | (list)

Ids of the rows to be deleted (When the filter parameter is used this property is ignored).

filter | (optional) (object)

Allows deletion of multiple rows by matching them with this filter, see Query Filters for options.

default: {}

admin | (optional) (bool)

Perform permission check based on administrator status of the user. If calling user is an administrator it can access all tables within their organisation.

default: false

Additional Parameters for Subtable access

Only when targeting a subtable the parameters sub_table_cx and sub_table_parent_row_id are required. Sub tables are individual properties of row, so to target the individual cell in the table a row and column are needed. (E.g. positions in an invoice)

sub_table_cx | (string)

Defines the column where the subtable is stored.

default: empty

sub_table_parent_row_id | (string)

Work on the subtable that is stored in this main-row.

default: empty

Reply Parameters#

There are no reply parameters except for the general failure/success indictor.

Examples#

Minimal Example

This example deletes a row with the row_ids parameter

The request#
{
    "table_id": "65DEF49C682194B07F7F9FDB24948904",
    "row_ids": ["697237F01E599A564B72B72C104E15C8"]
}
The reply.#
{
    "result": true
}

Example with filter

In this example a filter is used to delete all rows where the value c0 is larger than 0.

The request#
{
    "table_id": "65DEF49C682194B07F7F9FDB24948904",
    "filter": {
        "c10": {"$gt": 0}
    }
}
The reply.#
{
    "result": true
}