- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2022 10:07 AM
I need to read all the data from an excel which is in a normal row-column format. Any handy solutions can anyone suggest pls.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2022 10:09 AM
Hi Dilip,
Best solution is to use GlideExcelParser to play with the data from an excel.
Please check below link for the entire class and its different methods.
https://developer.servicenow.com/dev.do#!/reference/api/quebec/server/GEPS-getRow
Adding the sample code for reference.
var parser = new sn_impex.GlideExcelParser();
var attachment = new GlideSysAttachment();
// use attachment sys id of an excel file
var attachmentStream = attachment.getContentStream(<attachment sys id>);
parser.parse(attachmentStream);
//retrieve the column headers
var headers = parser.getColumnHeaders();
var header1 = headers[0];
var header2 = headers[1];
//print headers
gs.info(header1 + " " + header2);
while(parser.next()) {
var row = parser.getRow();
//print row value for both columns
gs.info(row[header1] + ' ' + row[header2])
}
Please mark correct/helpful if applicable.
Regards,
Shubham
Shubham Tipnis
ServiceNow Enthusiast
⭐️ 3x Rising Star (2022–2024) – ServiceNow Community
Sharing insights, use cases & real-world learnings from the Now Platform
Always learning. Always building.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2022 10:09 AM
Hi Dilip,
Best solution is to use GlideExcelParser to play with the data from an excel.
Please check below link for the entire class and its different methods.
https://developer.servicenow.com/dev.do#!/reference/api/quebec/server/GEPS-getRow
Adding the sample code for reference.
var parser = new sn_impex.GlideExcelParser();
var attachment = new GlideSysAttachment();
// use attachment sys id of an excel file
var attachmentStream = attachment.getContentStream(<attachment sys id>);
parser.parse(attachmentStream);
//retrieve the column headers
var headers = parser.getColumnHeaders();
var header1 = headers[0];
var header2 = headers[1];
//print headers
gs.info(header1 + " " + header2);
while(parser.next()) {
var row = parser.getRow();
//print row value for both columns
gs.info(row[header1] + ' ' + row[header2])
}
Please mark correct/helpful if applicable.
Regards,
Shubham
Shubham Tipnis
ServiceNow Enthusiast
⭐️ 3x Rising Star (2022–2024) – ServiceNow Community
Sharing insights, use cases & real-world learnings from the Now Platform
Always learning. Always building.