Reading the content of attachment files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 02:51 PM
I'm trying to read the data from the attachment and load the data to an html field. I've been able to get it to work. But in our case, we could have up to three attachments for three different html fields. This getBytes() only identifies the record id and not the attachment sysid so I cannot retrieve the individual attachments. It will pull up any of the attachments data and load the same one to all three. Any ideas to get to the attachment record level?
var sysAddress = current.sys_id;
var gsa = new GlideSysAttachment();
var bytesInFile = gsa.getBytes('incident',sysAddress);
var originalContentsInFile = Packages.java.lang.String(bytesInFile); // originalContentsInFile
originalContentsInFile = String(originalContentsInFile);
current.u_excluded_adddress = originalContentsInFile;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Perhaps the newer Document Intelligence AI tool will work for this?