Overview
Many APIs support standard operations such as record creation, updating, and deletion. Some APIs also provide an Upsert function, which combines insert and update operations into a single action.
When an API does not support native Upsert functionality, organizations must implement alternative workflows. This guide explains how eZintegrations enables Upsert-like behavior by combining multiple operations within an API-to-API integration.
When to Use
This approach should be used when integrating with APIs that do not provide built-in Upsert functionality.
- When APIs support only insert and update operations separately
- When duplicate bridge creation must be avoided
- When data synchronization requires conditional insert or update logic
- When building API-to-API integrations
How It Works
eZintegrations simulates Upsert functionality by evaluating API responses and applying conditional logic through operations.
The workflow first checks the API response status. Based on this status, it decides whether to insert a new record or update an existing one.
This process uses transformation and filter operations to manage data flow and ensure accurate record handling.
Configuration Steps
Step 1: Configure the Source
Select the source as API and choose the required product name and business object.
Step 2: Add API Details
Enter API details, including headers, body, and pagination settings if required. Use the Test button to validate the API response.
Step 3: Configure Operations
Click Next to access the Operations section. The Upsert logic is implemented using multiple operations.
Singleline to Multiline
This operation converts single-line JSON data into a multiline format.
['bizdata_dataset_response']['data']
API Operation
This operation is used to transmit data between systems. Configuration is performed in the same way as source and target API settings.
Rename Operation
The Rename operation prevents key conflicts by changing existing field names.
"bizdata_dataset_status":"api_status"
Filter Operation (Insert Condition)
The Filter operation applies conditional logic using logical, identity, membership, and comparison operators.
In the first condition, records are inserted when the API response status is not equal to 200.
data['api_status'] != '200'
Append Operation (Insert)
The Append operation adds a new column indicating that a record was inserted.
record_action: "Insert"
Filter Ends
This step ends the first conditional filter operation.
Filter Operation (Update Condition)
In the second filter condition, records are updated when the API response status is equal to 200.
data['api_status'] == '200'
Append Operation (Update)
The Append operation adds a new column indicating that a record was updated.
record_action: "Update"
Step 4: Configure the Target
After defining all conditions and transformations, click Next to proceed to the Target configuration.
Select the target as API and choose the required product and business object. Use the Update API for updating records.
Step 5: Submit the Integration
After entering all required details, click Submit to complete the API-to-API integration.
The configured workflow will now perform Upsert-like operations during data synchronization.
Troubleshooting
If the Upsert workflow does not function as expected, verify the following:
- Ensure API response status codes are correctly captured
- Confirm Rename and Filter operations are configured properly
- Validate source and target API endpoints
- Check Append operation key names
Frequently Asked Questions
What is Upsert in API integrations?
Upsert is a combined operation that inserts new records or updates existing ones based on predefined conditions.
How does eZintegrations enable Upsert without native support?
It uses conditional filters and transformation operations to determine whether to insert or update records.
Why is the Rename operation required?
It prevents conflicts between system-generated fields and custom fields during processing.
Can this method be used for all APIs?
This method is applicable to APIs that return identifiable response status codes.
Is coding required to implement this workflow?
No, the workflow is implemented using platform operations without custom coding.
Notes
This guide demonstrates how to implement Upsert-like behavior using eZintegrations operations.
Only the steps and features described in this document are supported.