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-26-2020 09:06 AM
Hi,
csv file is similar to plain text file so it would work.
There is no direct way to create data with Excel file and attach to record.
you might have to use custom approach
Generating customized csv or .xls file
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-26-2020 10:24 PM
Hope you are doing good.
Let me know if I have answered your question.
If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2020 10:13 PM
Hope you are doing good.
Did you get a chance to check on the links provided to resolve your query?
If your query is resolved please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2020 03:24 AM
Hope you are doing good.
Did you get a chance to check on the solution provided to resolve your query?
If your query is resolved please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader