How can I create an Excel file from a script in Servicenow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2021 11:25 AM
I just need a really simple example of how I can create a .xlsx file not .csv. What is the syntax for this when writing with GlideSysAttachment().write?
I've tried:
var gsa = new GlideSysAttachment();
gsa.write(fixGr, 'test.xlsx', 'text/xlsx', data);
but when I go to open the created attachment in Excel, Excel says its may be corrupted or the wrong file type.
Can anyone please provide a simple example of what the data would look like and how to write it properly?
pls help
- 6,221 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2021 11:34 AM
Hi,
Did you checked this?
https://community.servicenow.com/community?id=community_article&sys_id=35679790db1bcc90414eeeb5ca9619a7
https://community.servicenow.com/community?id=community_question&sys_id=575b0b21db9cdbc01dcaf3231f961955
Hope this helps
Thank you
Prasad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2022 02:54 AM
First, select the Automate tab on the ribbon. This will expose your two primary options in the Scripting Tools group: Record Actions and New Script. To create a new Office Script, press the Record Actions button, then start taking the steps you want to automate.
Regards,
Rachel Gomez
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2021 01:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2022 06:56 AM
Hey,
This link seems not available anymore.
If you are able to access it, please could you create a blog article?