Import and adjust big XML

Elias Moser
Tera Contributor

My goal is to import a big XML file (32MB) and then also adjust the data within the data source which loads the XML. In my current approach, you upload the file into an attachment and the data source will then read the content out of the file and parse it into a JSON, so i can adjust the data to how i need it.

My problem is, that i cant read the data out of the file, since it exceeds javascript's string size (something around 3.3mil characters).

 

Ive unsucessfully already tried the following things:

- Spliting the file into chunks, parsing the chunks and then combining them doesnt work, beacuse i cannot parse an invalid xml structure.

- Ive tried using Unit8Array's but you cannot parse them into a JSON without having to parse them into a string first.

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@Elias Moser 

I don't think you can parse that big file in ServiceNow

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader