import_records
Bulk-import up to 1000 records into a data model, creating each row or updating existing matches using an upsert key to prevent duplicates. Returns per-row results and errors.
Instructions
Bulk-import records into a data model (up to 1000 rows). Without upsertKey each row CREATES a record; with upsertKey (a unique field or the product SKU field) a row matching an existing record UPDATES it instead, so a repeated sync does not duplicate. A translatable field takes a language map ({ title: { en: '...', no: '...' } }); a language the workspace has not enabled is rejected. Returns importedCount (created), updatedCount, per-row errors, and per-row record ids with CREATED / UPDATED / UNCHANGED.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | Array of plain objects keyed by the model's field keys. A translatable field (localized: true on the model) takes a language map, e.g. { title: { en: 'Ball bearing', no: 'Kulelager' } }. Without upsertKey each row creates a record, so every language the row should have must be in it. A row matched through upsertKey is merged into the existing record: only the keys the row carries change. | |
| upsertKey | No | A key from the model's uniqueFields, or its product skuField. A row whose value matches an existing record updates that record; any other row is created, so re-running the same file does not duplicate it. Every row must carry the key. Not allowed on member (auth) models. | |
| modelIdOrSlug | No | Target model id or slug |