Parse EXCEL file into JSON
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2018 02:35 AM
hello,
it is possible to parse an excel file into a json in script include .
if it s possible how we can do it.
thanks,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2018 02:55 AM
Hi Soukayna,
I'm curious about what problem are you trying to solve: could you share more details?
[]'s
Andre Moreira
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2018 03:07 AM
hey andré,
i have a ui action that allow me to import data in my table, but before that i need to compare the header of the excel file with my table column to be sure that it's the corresponding file .
any ideas pls ?
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2018 04:33 AM
Hi Soukayna,
If it would have been csv then following code will give you attachment content in scoped app.
But this code won't work for xls or xlsx file.
var gr = new GlideRecord('sys_attachment');
gr.addQuery('sys_id', '8347eef44f330300fc11fa218110c722'); // give sys_id of attachment record
gr.query();
if (gr.next()) {
gs.info('Found Attachment.');
var ga = new GlideSysAttachment();
var content = ga.getContent(gr);
gs.info(content);
}
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2018 05:52 AM
hey Ankur,
with csv it works but i need xsl/xlsx file and it doesn't work when i use the same code
any idea how to read xls / xlsx header file
thanks,