How to send attachment files in base64 format?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2019 10:32 AM
Hi All,
We have integrated servicenow with service grid tool for case exchange purpose.
Can anyone please help me on how to send attachment files in base64 format from servicenow.
I have tried with all possibilities.
Following is my code that i am using for payload:
var sa = new GlideSysAttachment();
var StringUtil = Packages.com.glide.util.StringUtil;
//Get the base64 encoding of the attachment
var binData = sa.getBytes(current);
var encData = GlideStringUtil.base64Encode(binData);
var s = new sn_ws.SOAPMessageV2('soap_message', 'http_method');
s.setStringParameterNoEscape('Filename', current.file_name);
s.setStringParameterNoEscape('TaskNumber', current.table_name.number);
s.setStringParameterNoEscape('Payload', encData);
Seems not working!!
Please can any one help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 04:31 PM
In San Diego, these functions work in Global. If this is in a business rule running on sys_attachments, it needs to be an After rule rather than a Before rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2019 12:07 PM
HI
Try this below
https://developer.servicenow.com/app.do#!/api_doc?v=kingston&id=r_SGSYS-base64Encode_S
http://www.john-james-andersen.com/blog/service-now/easy-base64-encoding-in-servicenow.html
Thanks and Regards
Dilip Puligilla