Transform Map - How to delete data from the target table not in the source table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 06:16 PM
The source table contains only the latest information, while the target table contains both the latest and old information.
How can I extract and delete the old information from the target table?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 06:37 PM
@Yuri____ Data is usually imported in the import set tables first. You can use an onComplete transform script to compare data between your target table and import set table on the basis of a key field and choose to delete the data which doesn't exist within the target table.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 06:40 PM
Hi @Yuri____ ,
You can configure the transform map for delete operation as end to process using the onComplete Script.
As per transform map script the onComplete will executes at the end of an import after all rows are read and transformed.
Refer : Transform Event Scripts
You need to consider the variable ( or flag ) on target table which can segregate the latest and old records, if that flag is updated on today's date ( or true/false ) type then onComplete script can read and delete those records at end which are not updated ( flag ) by current execution.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 07:05 PM
It's not recommended to delete the target record
your data import will insert or update based on coalesce in your field map.
If the source fields has latest then it will get updated on target and you need not worry
how are you loading the data?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2025 06:58 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader