- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2025 11:07 AM
Hi All,
I am trying to achive to pull the data from excel data sheet to Mrvs. Which I am able to but now I want that the excel should take the required data in mrvs from row 4 ownward and row 3 is work as header. like below ss. where row 3 are headers and I am sharing my script script include where I am getting attcahemet. please let me know what changes I need to make in the script to achive this.
script include----
getdata: function() {
var id = this.getParameter('sysparm_id');
var obj = [];
var excelid = id;
var parser = new sn_impex.GlideExcelParser();
var attach = new GlideSysAttachment();
var attachmenttest = attach.getContentStream(excelid);
parser.parse(attachmenttest);
while (parser.next()) {
var row = parser.getRow();
obj.push(this.prepareData(row));
}
return JSON.stringify(obj);
},
@Ankur Bawiskar can you help me with this
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2025 03:11 AM
Hi,
The lines I have added will skip the first three line. Did you try the script?
Palani

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2025 12:38 PM
Hi,
You can make the highlighted modification:
getdata: function() {
var id = this.getParameter('sysparm_id');
var obj = [];
var excelid = id;
var parser = new sn_impex.GlideExcelParser();
var attach = new GlideSysAttachment();
var attachmenttest = attach.getContentStream(excelid);
parser.parse(attachmenttest);
var rowNum = 0;
while (parser.next()) {
rowNum = rowNum + 1;
if(rowNum >3){
var row = parser.getRow();
obj.push(this.prepareData(row));
}
}
return JSON.stringify(obj);
},
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2025 01:42 AM
@palanikumar @Ankur Bawiskar this will not work as I want header in 3 row then from the 4 row I will enter the data. the script given by you only work when header in 1st row . so how to make header in 3 row as I shared excel sheet above
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2025 03:06 AM
please share complete script and screenshots as well.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2025 03:11 AM
Hi,
The lines I have added will skip the first three line. Did you try the script?
Palani