Attachments as retrieveData\(\) return values
concept australia Updated Sep 10, 2026 1 min read c_AttachmentsAsReturnValues.md
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
32 lines · 1.7 KB
---
title: Attachments as retrieveData\(\) return values
description: 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.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/australia/security-management/vulnerability-response/c\_AttachmentsAsReturnValues.html
release: australia
product: Vulnerability Response
classification: vulnerability-response
topic_type: concept
last_updated: "2026-09-10"
reading_time_minutes: 1
breadcrumb: [Vulnerability integration script, Define a new vulnerability integration, Manually create a vulnerability integration, Vulnerability Response integrations, Vulnerability Response, Unified Security Exposure Management, Security Operations]
---
# Attachments as retrieveData\(\) return values
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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/security-management/vulnerability-response/c_MultipleCallIntegrations.md), 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
| title | Attachments as retrieveData\(\) return values |
| description | 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. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/australia/security-management/vulnerability-response/c\_AttachmentsAsReturnValues.html |
| release | australia |
| product | Vulnerability Response |
| classification | vulnerability-response |
| topic_type | concept |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| breadcrumb | Vulnerability integration scriptDefine a new vulnerability integrationManually create a vulnerability integrationVulnerability Response integrationsVulnerability ResponseUnified Security Exposure ManagementSecurity Operations |