Convex icon

Convex

Interact with Convex API

Actions10

Database (Function) → Create Row

AI-generated

Summary

Create a new row in a specified database table within Convex by sending data either auto-mapped from all input fields or manually defined per column.

Inputs

  • Table Name (required) — The name of the table where the new row will be created.
  • Data to Send (required) — Choose how to define the data sent: auto-map all input data fields as columns or manually specify each column and value.
  • Inputs to Ignore — When auto-mapping, provide a comma-separated list of input fields to ignore from the data sent.
  • Fields — When manually defining data, specify individual fields and their values to set in the new row.

Output shape

a list containing a single JSON object representing the created row including its data fields

The operation returns the created database row data as JSON in an array. When auto-mapping, input fields named 'id', '_id', or empty strings are ignored automatically. Errors return an operation failure.

Examples

Example 1: Create a row by auto-mapping all input data fields

Set 'Table Name' to target table, select 'Auto-Map Input Data to Columns', optionally specify 'Inputs to Ignore' to exclude fields from input.

Example 2: Create a row by manually defining column values

Set 'Table Name', select 'Define Below for Each Column' for 'Data to Send', then add one or more fields with 'Field Name' and 'Field Value' pairs.

Links

Discussion