Clear Matching Row Data

BlockDatabases

Find rows matching a query and clear selected columns from all of them.

Inputs

DatabaseRequired

Select the database containing the rows.

Limit

Maximum number of rows to clear (default: 100, max: 1000).

Example: 100

ColumnsRequired

Comma-separated column names or column IDs to clear. System columns cannot be cleared.

Example: name, points

Query

Define filters to find the rows to clear.

Set up in the editor. The JSON format is under advanced documentation below.

Outputs

Updated Count

The number of rows that were cleared.

Example: 5

Build a bot using blocks like Clear Matching Row Data

Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.

Advanced Documentation

This documentation can be useful when using code mode. View as Markdown

ID: db_clear_matching_row_data

Inputs

FieldInventScript nameValue
Databasedatabase_id
Limitlimite.g. "100"
Columnscolumnse.g. "name, points"
Queryquery_jsonJSON text
query_json format: JSON text of type DatabaseQuery. Fields marked ? are optional.
type DatabaseQuery = {
	where?: FilterGroup
	sort?: SortClause[]
	limit?: number
	offset?: number
}

type FilterGroup = {
	logic: string // "and" or "or"
	conditions: FilterCondition[]
}

type FilterCondition = {
	type: string // "comparison" or "group"
	columnId?: string // comparison only
	operator?: string // comparison only: eq, neq, gt, gte, lt, lte, contains, not_contains, starts_with, ends_with, is_empty, is_not_empty
	value?: string // comparison only
	group?: FilterGroup // group only
}

type SortClause = {
	columnId: string
	direction: string // "asc", "desc" or "random"
}

Outputs

FieldInventScript nameValue
Updated Countupdated_counte.g. "5"

Example InventScript

clearMatchingRowData := db_clear_matching_row_data(Args{database_id: "...", columns: "name, points"})
send_text_message(Args{
	channel_id:      trigger.channel_id,
	message_content: "Updated Count: " + clearMatchingRowData.updated_count,
})

More databases blocks