GlideSysAttachment not working for xlsx

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2022 05:44 AM
When I run this code, and when the generated excel file that is downloaded and opened gives the following error:
The code works for content type xls and csv's.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2022 05:51 AM
Hi,
for the content variable, is the text you've used just placeholder or what you're actually trying to push? If so, that would be the issue as an xlsx file expects a certain type of encoding. CSV on the other hand is just a comma separate text file

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2022 06:16 AM
Yes its a simple placeholder.
But ultimately i will try to do a key value pair something like this:
But this is the second step
But Trying to use the documentation and just change the content type example: https://developer.servicenow.com/dev.do#!/reference/api/rome/server/no-namespace/c_GlideSysAttachmentScopedAPI which is the first step
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2022 05:58 AM
Try replace the content type piece with the following:
var rec = new GlideRecord('incident');
rec.get('540c24151b5f0550a6500f2bdc4bcbaa');
var fileName = 'example.xlsx';
var contentType = '*/*';
var content = 'The text that is stored inside my file';

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2022 06:09 AM
No this does not work.