Actions27
- Database Actions
- Storage Actions
Database → Update
AI-generatedSummary
Upsert rows in a Supabase table by matching on a specified column: update existing rows that match the match column value, or insert new rows if no match is found. Each input item must contain the match column in its data. Provide input data either as simple column/value pairs (Columns) or a JSON object (JSON Data). Optionally enable duplicate removal by the match column to prevent conflicts. Select which fields to return (returnFields, default: all). Processes input items in batches for efficiency.
Inputs
- table (required) — Name of the table to operate on
- matchColumn (required) — Column used to match rows for updating (typically the primary key). Each input item must include this column in its data.
- uiMode — Input mode: 'Simple' for form fields and dropdowns (Columns), 'Advanced' for JSON input (JSON Data). Default: 'simple'.
- columns — Column/value pairs for update data (only visible when uiMode is simple). Each column requires a name (from table columns) and a value.
- jsonData — JSON object containing update data (only visible when uiMode is advanced). Default: '{}'.
- deduplicateByConflict — When enabled, removes duplicate rows by the match column before processing (keeps last occurrence). Prevents 'ON CONFLICT DO UPDATE command cannot affect row a second time' error. Default: false.
- returnFields — Comma-separated list of fields to return (* for all). Default: '*'.
Output shape
Array of items, each containing a 'json' property with the updated/inserted row data (selected fields per returnFields). If no rows are affected, returns a single item with { json: { data: [], operation: 'update', table } }. If input is empty, returns a single item with empty json.
Processed in batches of up to 500 items. Deduplication (if enabled) reduces input items by match column duplicates before processing.
Examples
Example 1: Update a user's email by user ID
Table: users, matchColumn: id, uiMode: simple, columns: [{ name: email, value: new@email.com }], deduplicateByConflict: false, returnFields: id,email
Example 2: Create new product if SKU doesn't exist, otherwise update price
Table: products, matchColumn: sku, uiMode: advanced, jsonData: { sku: 'ABC123', price: 29.99 }, deduplicateByConflict: true, returnFields: *