- 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
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
06-02-2023 10:23 PM
I tried to create a script step with the code above but output is empty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2023 08:18 PM
can you post a new question and tag me there as this is an older thread?
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:33 PM
@hariharanvl ; did you get it working?