- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2018 11:16 AM
Is there an out of box way to process an XML import file via script rather than GUI? ( instead of going to "Import XML" have a script that pulls the file by location or content and processes it? )
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2018 04:34 AM
No good global solution was found unfortunately. You could probably get away with doing it for 1 or a handful of tables if you are really careful, but it is probably not worth it in that regard.
I checked with SN and they said the actual import process cannot be called via script. Disappointing, hopefully one day "releases" into service-now will be able to be automated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2020 01:15 PM
I don't think that the Import Set API is going to solve this requirement. Imagine importing a group via XML. The sys_id for the group will be preserved. However when transforming via an import set you could create a new group, but the sys_id would be the same. Thus, this API isn't really a way to script a manual XML import. Please correct me if I'm thinking of this wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2018 05:26 AM
Thanks Sachin and Michael, I will try out the Rest API this week(hopefully)!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2018 04:34 AM
No good global solution was found unfortunately. You could probably get away with doing it for 1 or a handful of tables if you are really careful, but it is probably not worth it in that regard.
I checked with SN and they said the actual import process cannot be called via script. Disappointing, hopefully one day "releases" into service-now will be able to be automated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2022 10:04 PM
well, there is a way to do it by using the attached tool.
you can import the attached scripts to your instance, check the readme.
the way it works: you need to create your JSON with the records you want to export and run this tool.
the tool creates an update set with the files you mention. you can import them as an update set in other instances as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2023 05:08 AM - edited ‎06-30-2023 05:08 AM
Hi Pfeifn,
This is possible by using the GlideUpdateManager2. You can simulate an XML to be loaded as if it came from an update set by using the loadXML function:
var xml = '<record_update sys_domain="global" table="cmdb_ci"><cmdb_ci action="INSERT_OR_UPDATE">...</cmdb_ci></record_update>'; //provide your full xml (or get it from an attachment)
var um = new GlideUpdateManager2();
um.loadXML(xml); //load that xml