UPSERT Runs Successfully but Doesn't Insert or Update Data
Overview
Sometimes an integration run in Skyvia finishes with Success, but no new data is inserted or updated in the target table. This situation most often occurs when using the UPSERT operation.
Why This Happens
UPSERT decides whether to Insert or Update a record based on the ID (primary key) field:
- If ID is NULL, Skyvia performs an Insert.
- If ID is NOT NULL, Skyvia performs an Update.
If the source provides an ID value that does not exist in the target, Skyvia tries to update a record that is not there. The run completes successfully, but no rows are changed — because there is nothing to update. This is expected behavior, not an error.
When This Typically Occurs
- Source and target do not share the same IDs.
- The source should not provide the target's ID directly.
- Records should match by another business identifier (e.g., email, external code, number, etc.).
Solution: Use Lookup Mapping for the ID Field
Instead of mapping the target ID directly, configure it as a Lookup based on another unique field. In the Lookup settings, enable the Set null when no record found option.
Result:
- If a matching record exists in the target, Skyvia performs an Update.
- If no matching record exists, the ID becomes NULL and Skyvia performs an Insert.
Steps to Configure
- Open the integration task and go to Mapping.
- Find the ID (primary key) field in the target.
- Change its mapping type to Lookup.
- Select the source field(s) that uniquely identify the record.
- Enable Set null when no record found.
- Save and run the task again.
Behavior With and Without a Lookup
| Scenario | Without Lookup | With Lookup |
|---|
| Matching record exists | Updates the record | Updates the record |
| No matching record exists | No action, run succeeds | Inserts a new record |
Related Articles
Mapping the RowNo Column for UPDATE/UPSERT Operations in Google Sheets
Overview When performing UPDATE or UPSERT operations on Google Sheets data in Skyvia, the RowNo field is mandatory. RowNo is a unique auto-generated row number assigned to each row in the sheet. Skyvia uses it to identify which row to update. Without ...
The specified lookup is ambiguous: Lookup must return at most one row
Overview This error occurs when a Lookup operation returns multiple matching records for the specified condition. Lookups are designed to find and act on only one record. When that is not possible, this error is triggered. Resolution Options Option ...
Integration Failure Types in Skyvia Data Integration
Overview When using Skyvia Data Integration, you may encounter two distinct types of integration failures: 1. Record-Level Errors These occur when one or more individual records fail to process during an integration task. For example, in operations ...
A Quick Guide to Importing and Updating Audience Members in Mailchimp
Overview This article explains how to configure an UPSERT operation for the Mailchimp ListMembers object in Skyvia. This is the recommended approach for importing and updating Audience members without creating duplicates. How UPSERT Works for ...
Understanding Records in Skyvia Data Integration
What Is a Record? A record in Skyvia Data Integration represents a single row in a database table or a single object in a cloud source (e.g., one contact in Salesforce, one row in a Google Sheet). Every integration operation - Import, Export, ...