Import Sets XML attributes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2023 05:43 AM - edited 11-13-2023 04:25 AM
Hello,
I have an issue with importing big XML files with data, from which I need to get the values of the XML node and the value of the XML node attributes in some cases. For example:
<my-item name="my-title-attribute-name-value">
<title xml:lang="en-US">My Item Title Content Value</title>
</my-item>
So I need to get both title content values and in some cases with other XML nodes - my-item node name attribute values or even title node xml:lang attribute values.
I would like to speed up the import using ServiceNow Import Sets. The problem I'm facing is that the Data Source setup for XML Attachment import gives me the ability to point out the XPath only for the row in the stage table, but I don't see an option to specify XPath for each column of the row. At the moment all the attributes of the respective XML nodes, that are auto-translated into columns, are ignored.
Do you have any idea how I can get ServiceNow import sets functionality to take the attributes into the Staging table in order to use them later on in my target table?
Currently, I'm doing this with GlideTextReader and parsing the content I need using XMLDocument2 parsers, reading the document line by line. This is time and resource-consuming.
I tried optimizing it in several ways, by using progress workers, etc, but it's still a very heavy and long task.