Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2023 10:17 AM
Hi all,
Need a help can we write the cell or edit the cell in excel using GlideExcelParser if not by this is there is a way we can achieve this?
Thanks
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2023 10:53 AM
Hi @William08
To read the file as below
var csvFileCount=0;
var ritmGr=//Gr can be of any table where csv is present;
var RITMsys_id= ritmGr.getUniqueValue();
var gsa = new GlideSysAttachment();
var agr = gsa.getAttachments('sc_req_item', RITMsys_id);
var gsa1 = new GlideSysAttachment();
var agr1 = gsa1.getAttachments('sc_req_item', RITMsys_id);
while(agr1.next())
{
var bytesInFile = gsa.getBytes(agr1); // tablename, table sysID
var originalContentsInFile = Packages.java.lang.String(bytesInFile); // originalContentsInFile
originalContentsInFile = String(originalContentsInFile);
var fileData = originalContentsInFile.split('\n');
var csvHeaders = fileData[0] ;
var csvHeadersValues = csvHeaders.split(','); //"," is the delimiter
gs.info(fileData)
gs.info(csvHeaders )
}
Thanks and Regards,
Saurabh Gupta
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2023 11:09 AM
Thanks @Saurabh Gupta