How to populate an attachment variable

suvro
Mega Sage
Mega Sage

Hi,

I have a record producer, where I have an attachment variable.

From an onLoad client script I am getting a png file from external source through REST API in a base64 format

Now the question is how to populate this file to the attachment variable?

I have gone through the GlideSysAttachment APIs but that attaches the attachment to a table record. How to populate the attachment directly to the variable?

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@suvro 

will the file be same always which you are fetching?

 

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

suvro
Mega Sage
Mega Sage

No it wont be the same file