- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2022 11:09 PM
We are considering a method to roll back when an error occurs in the process of inserting the contents of the CSV file into the table one record at a time with the ServiceNow script.
Is it possible to implement rollback processing in a ServiceNow script?
I will post the scripts I have created so far, so I would appreciate it if you could also teach me how to implement it if possible.
<Example>
If an error occurs in rec.insert (); of the 5th record of the CSV file, I want to cancel the data of the 1st to 4th records.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2022 12:01 AM
That's why it's better to use import set so data can be verified before the actual import.
That said, following article has information on rolling back.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0826303
sys_rollback_context table has information.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2022 12:01 AM
That's why it's better to use import set so data can be verified before the actual import.
That said, following article has information on rolling back.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0826303
sys_rollback_context table has information.