Using local copy of SheetJS

gdm1411
Mega Contributor

I would like to use the Excel javascript library SheetJS (GitHub - SheetJS/js-xlsx: SheetJS Community Edition -- Spreadsheet Parser and Writer) in a UI page.   I've created the page. and referenced the github files, and all works well.   The actual .js file is found at   https://raw.githubusercontent.com/SheetJS/js-xlsx/master/dist/xlsx.full.min.js and it's about 870kb.

Now I need to move the library into my instance of service now, as our production environment is on a closed network, and we have no access to github.

I tried making a script include, but it tells me there is a 64k limit.

I successfully created a UI script.   When I put in the url in my browser, with a .jsdbx extension, it asks me if I'm downloading a file - I save it, and it looks like the original javascript.

However, when I reference it in my UI page, it throws an exception (can't find XSLX object), so I'm obviously doing something wrong.   If you can't tell, I'm new to SN.

I'm just looking for the right way to put the original file on the SN instance, and reference it in my pages.   Any direction would be appreciated.

GregM

1 ACCEPTED SOLUTION

gdm1411
Mega Contributor

Well, it appears the only solution is to host the file on another web server on our closed network, say IIS or Apache, and fetch it from there into the SN page.



Best I can tell, SN does not support the idea of just hosting a page (or file).


View solution in original post

9 REPLIES 9

Gaurav Bajaj
Kilo Sage

Hi Greg,



Instead of trying an external library, you can try GlideExcelParser API which is inbuilt and can parse .xlsx files( which are present in sys_attachment table)


https://developer.servicenow.com/app.do#!/api_doc?v=kingston&id=GlideExcelParserScopedAPI




Thanks


Gaurav


Gaurav,



Thanks.   That's good to know, but I'm using Helsinki.   It does not seem to be available.


Yeah, its available starting Istanbul I believe though it's better to get upgraded.


In looking at the docs. it appears in Jakarta.   As you can imagine, I have no control over the version.



So I'm still looking for a way to upload and reference.