Process an excel file attached to a fix script main(); function main() { var excelDataJSON = this .getData(); if (excelDataJSON == null ) { gs.info( "No data in the excel file" ); return ; } this .processData(excelDataJSON); } function processData(excelDataJSON) { excelDataJSON.forEach( function (row) { var approle = row.application_role; var upn = row.upn } } function getDataFromAttachedExcelFile(grAttachmentSysId) { var myobjArray = []; var attachmentSID = grAttachmentSysId; // pass your excel attachment sys_id var parser = new sn_impex. GlideExcelParser (); var attachment = new GlideSysAttachment (); // use attachment sys id of an excel file var attachmentStream = attachment.getContentStream(attachmentSID); parser.parse(attachmentStream); while (parser.next()) { var row = parser.getRow(); var myData = ...
All things ServiceNow... take a look at my channel: https://www.youtube.com/@cloudminus89