- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 10:06 PM
I want to run Scheduled data pre import script to delete all the records from the target table before importing new data from the data source.
Issue: I want to know if this pre import script will run even if the data is not imported? Eg: While data import there maybe connection issues as this data is coming from a data source. In this case the pre import script should not delete the data from the target table.
Please let me know how this pre import script runs or please suggest any other way to delete target records before loading new records in a safe way.
Thanks,
Utpal
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 01:23 AM
I would suggest you try first with pre-import and add some logs and verify
But I would recommend using onStart since they will trigger once data is successfully imported into staging table. So in that way you are safe
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-01-2024 10:44 PM
your data load is based on ftp, https etc?
there are few objects available in those script. one of those is import_set. Using that you can check if import was successful or not and based on that proceed with deletion
Scheduled data import scripting options
Why not have the deletion then in onStart transform script of that transform map?
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-2024 01:05 AM
Thank you for marking my response as helpful.
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-2024 01:09 AM
Thanks @Ankur Bawiskar ,
Can you suggest if we are using JDBC type of data load then do we need to check import_set with pre import script or the script only will run after successful successful import to delete records from target table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 01:23 AM
I would suggest you try first with pre-import and add some logs and verify
But I would recommend using onStart since they will trigger once data is successfully imported into staging table. So in that way you are safe
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