Attachments as retrieveData\(\) return values

concept brazil Updated Sep 10, 2026 1 min read c_AttachmentsAsReturnValues.md
Raw file servicenow.com

Sometimes, it is preferable be return an attachment from retrieveData(). The logic to create and/or retrieve an attachment is implementation-specific, but after the attachment is known, its information can be returned.

To provide an attachment, retrieveData() returns an object like:

Text
{       contents: "attachment-sys-id",       contentType: "sys_attachment"}

An example that extends on the previous example, but saves the response body of the REST Message to the integration process record follows. It then returns that attachment identifier as the contents of the return object.

[Omitted image "AttachmentAsRetValue.png"] Alt text: Script with attachment as retrieveData return value

Search documentation
Search document titles and file paths on the brazil branch