---
sourceDocument: Australia Security Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/security-management

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia Security Management

ft:clusterId :

    - security

bundleId :

    - security

workflow :

    - Technology


---

# Attachments as retrieveData() return values

# Attachments as retrieveData() return values {#ariaid-title1}

* Release version: Australia
* 
* Updated March 12, 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

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:

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

An example that extends on the [previous example](https://servicenow-prod.fluidtopics.net/~sAFvNuB9ISAwO2aim0PdA "Multiple call (or multiple page) integration scripts are a bit more complicated. They require multiple calls to a data source to retrieve data."), 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.Figure 1. Return attachment from retrieveData

