Need help with excel attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-26-2020 08:56 AM
Hi , I m trying to write an attachment to a record. If I do it with the below code its executing fine with csv format. but when I trying to write it using xlsx its not giving the report in the correct format. Is there any difference in the input format for xlsx?
var attach = new GlideSysAttachment();
var attachFile = attach.write(table object,filename,+".csv",application/csv,data); // prints fine
if I replace csv with xlsx it doesn't print in the correct format.I even tried using JSON name value pair but no luck.
Can anyone please advise ?
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2020 10:15 PM
Hi there,
Can you explain what you mean with "doesn't print in the correct format"? For me this looks to be working fine.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field