Let's assume you want to sync data from an on-premise PostgreSQL database table called market_leads to a cloud database table called all_leads. Let's use incremental fetch in Zoho DataPrep to sync only new and modified records to the cloud database.
While exporting records to a cloud database, Zoho DataPrep allows you to choose how to add new rows to the table:
Zoho DataPrep does not update modified records in PostgreSQL when using the Append option; instead, it appends the modified rows to the destination table. This may result in duplicate records. To overcome this, please follow the solutions below:
To update modified records in your cloud database, you must compare the data in the output table with the incoming data and merge the records in DataPrep, then overwrite the output table with the merged data. Here's how it works:
Import the data from the market_leads table incrementally from your cloud database into DataPrep. This is the source table that contains the new and modified lead records, which need to be merged into the all_leads output table.
Formula transform to add a new column with timestamp:
Import the output table all_leads from your cloud database (e.g., PostgreSQL) into DataPrep. This data will be used to compare with the source data to identify which records are new or updated.
Now append both the tables and include the ZDP_timestamp column.
Identify the duplicates from the appended dataset and remove the records with earlier or no timestamp. Use the Deduplicate transform in the DataPrep studio page.
To apply column-wise deduplication:
1. Click the Transform menu, click Deduplicate, then select Column-wise.
2. Select the ID column to identify duplicates. You can choose to ignore case and whitespace to find duplicates.
3. Choose Manual conditions and enter the conditions to keep the rows if the ZDP_timestamp column has the latest timestamp.
Now, export the cleaned table to the existing table, i.e., All_leads master table, where all the leads data is stored in the cloud database, and choose to overwrite.
Make sure the target matching is done to avoid export failure. Click here to know more about target matching.
With this destination configuration, each pipeline run will export the complete dataset, including both newly added and modified records, and overwrite the destination table, ensuring there are no duplicates.
This ensures the master table remains up to date with the most current lead data.
This approach combines Zoho DataPrep with your Cloud Database.
This ensures your output dataset is always clean without manual inserts, updates, or deletes.
Import the market_leads table incrementally from your cloud database (e.g., PostgreSQL) into DataPrep.
This table contains the new and modified lead records.
In the market_leads table, add a new column (ZDP_timestamp) with the current timestamp using the Formula function. This will help you track when each new or modified record was last updated from Zoho DataPrep.
Formula transform to add a new column with timestamp:
Export the table to your cloud database (eg, PostgreSQL), all_leads_raw table, using the Append option.
At this point, your table (all_leads_raw) contains multiple versions of the same record (per ID) but with different timestamps.
Create a view all_leads_clean that always returns the latest record per ID using a window function:
When querying all_leads_clean, you’ll always get the deduplicated, most up-to-date dataset:
Example:
This table contains all records (including duplicates/updates) with timestamps.
id | name | modified_time | ZDP_timestamp |
1 | Alan | 2025-06-20 12:22:00 | 2025-08-10 10:15:00 |
2 | Francis | 2024-06-20 12:25:00 | 2025-08-10 10:15:00 |
3 | Dan | 2024-06-20 12:27:00 | 2025-08-10 10:15:00 |
1 | Al | 2024-06-21 01:29:00 | 2025-08-11 09:45:00 |
4 | Gaja | 2024-06-21 01:30:00 | 2025-08-11 09:45:00 |
5 | John | 2024-06-21 01:35:00 | 2025-08-11 09:45:00 |
This view returns only the latest record per ID:
id | name | modified_time | ZDP_timestamp |
1 | Al | 2024-06-21 01:29:00 | 2025-08-11 09:45:00 |
2 | Francis | 2024-06-20 12:25:00 | 2025-08-10 10:15:00 |
3 | Dan | 2024-06-20 12:27:00 | 2025-08-10 10:15:00 |
4 | Gaja | 2024-06-21 01:30:00 | 2025-08-11 09:45:00 |
5 | John | 2024-06-21 01:35:00 | 2025-08-11 09:45:00 |
For id = 1, only the latest record (Al with the most recent ZDP_timestamp) is kept.
Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.
If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.
You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.