how to get excel sheet data in mrvs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago - last edited 5 hours ago
Hello Everyone
I have requirement to add excel sheets data in catalog item's mrvs
I have two sheets in one excel file add and delete.
add sheet has following details:
| Action Request | Device Type | Device Name | Serial Number | FQDN | Address | Atlas | IP Type |
| add | server | awarepoint-6bd6 | 00603514752A | test | 10.212.105.115 | FDVC0659924 | static |
delete sheet has following details:
| Action Request | Device Type | Device Name | Serial Number | FQDN | Address |
| delete | server | SFSFOAM6993188 | MXL2034JB3 | sfsfoam6993188.sfo.ca.kp.org | Test |
I created script inlcude and onchange client script for it.
I am getting only first sheet data in mrvs and in second (delete) sheet values are not getting mrvs.
BElow is my script include Please suggest me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago - last edited 3 hours ago
Hi @Vinod S Patil
can you please provide client script SS what you are passing from the client side?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
@Sanjay191 yes have look at client script please
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Here it is
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
The stream is a cursor — once parse() reads it, it's at EOF. Your second sheet gets an empty read. Get a fresh stream for each sheet:
var attachment = new GlideSysAttachment();
var sheetNames = ['add', 'delete'];
for (var i = 0; i < sheetNames.length; i++) {
var stream = attachment.getContentStream(attachmentSysId); // fresh every time
var parser = new sn_impex.GlideExcelParser();
parser.setSheetName(sheetNames[i]); // BEFORE parse
parser.parse(stream);
while (parser.next()) {
var row = parser.getRow();
// process row
}
parser.close();
}
