- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2022 12:49 AM
Hi,
Currently we are integrating with 3rd party system through cutom spoke and flow designer for incident table, we need to pass the attachment to them, they have shared the request body in which we need to share the attachment as shown below
[{ "DataBase64": "", "NR": 0, "FileName": ""}]
Can anyone please help me how to send the attachment in above format??
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2022 08:48 PM
Hi,
you can use script action in flow designer and get the base64 encoded string; then return that as string and use it in next step
Sample script here for scoped app
var gr = new GlideRecord('sys_attachment');
gr.get('3fd6017407d3dc50540bf2508c1ed027');
var sysAtt = new GlideSysAttachment();
var base64Data = sysAtt.getContentBase64(gr);
gs.info(base64Data);
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
04-03-2024 07:25 PM
@Ankur Bawiskar ; this script is returning undefined data, can you please post the solution, if you have modified the code to convert attachment content to base64 .