- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2020 03:49 AM
Hi team ,
we wrote a BR to capture the attachment and convert o base 64,But i am facing issue to capture the multiple attachment for current incident
var tarRec = new GlideRecord(current.table_name);
var sa = new GlideSysAttachment();
var binData = sa.getBytes(current);
var base64Data = GlideStringUtil.base64Encode(binData);
var Attachment = new sn_ws.RESTMessageV2('ABC', 'XYZ');
Attachment.setStringParameterNoEscape('att_data', base64Data);
Attachment.setStringParameterNoEscape('att_type', current.content_type);
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2020 08:06 AM
did you use variable substitution for setting the attachment data?
you should create variable substitution something like this and then set the data
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
09-18-2020 03:55 AM
Hi,
check here and the proposal solution:
If I have answered your question, please mark my response as correct and/or helpful.
Thank you very much
Cheers
Alberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2020 03:56 AM
Hi,
Is the 3rd party accepting multiple attachments in single request?
please check with them and accordingly you can include those in the json request body
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
09-18-2020 04:02 AM
Yes in a single request have to send multiple attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2020 05:42 AM
then please check what should be the format.
i.e. which json key values are to be repeated
Example: My assumption below
[{
"att_data": "base64Data",
"att_type": "application/pdf"
},
{
"att_data": "base64Data",
"att_type": "application/txt"
}
]
you will have to iterate over and form the json body accordingly.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader