How to send attachments to 3rd party system through Base64?

User205031
Tera Contributor

Hi,

We are integrating with 3rd party system flow designer for sc_req_item table, we need to pass the attachment to them in base64 format.  In the script action in the flow ,used the below code but returning null to me.

 

var gr = new GlideRecord('sys_attachment');
  gr.addQuery('table_sys_id', inputs.bulk_csv);
  gr.query();
  while(gr.next()){
    var sysAtt = new GlideSysAttachment();
    var base64Data = sysAtt.getContentBase64(gr);
    gs.info(base64Data);
  }
outputs.attach = base64Data;
 
User205031_0-1739258148572.png

The 'attach' variable is returning null.

 

How to fix this?

Thanks in advance

 

7 REPLIES 7

@User205031 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@User205031 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@User205031 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader