Upload Attachment

Upload an attachment to your ServiceNow instance.

Input

Field Definition Type Required
File
File Content Contents of the attached file. File TRUE
File Name

Name to give the attachment.

Caution

File names cannot contain spaces.

For Microsoft Office files, specify the extension of the file name. For example, .docx.

String TRUE
Table Name Name of the table to which you want to attach the file. String TRUE
Table System ID Sys_id value of the record on the specified table to which you want to attach the file. String TRUE
Caution

A file must be at least 1 byte in size, but ServiceNow attachments cannot be larger than 1024 MB.

Output

Field Definition Type
Attachment
System ID Sys_id value of the attachment. The URL of the incident will usually contain this value. For example, for the URL https://instance.service-now.com/api/now/attachment/615ea769c0a80166001cf5f2367302f5, the sys_id value is 615ea769c0a80166001cf5f2367302f5. String
Size Size of the attachment in bytes. Number
Name File name of the attachment. String
Content Type Content type of the attachment's metadata, included in the message body for multipart uploads. String
Table Name Name of the table to which you want to attach the file. String
Table System ID Sys_id value of the record on the specified table to which you want to attach the file. String
State State of the incident to which an attachment is uploaded. String
Hash 128-bit (16-byte) hash value, in the form of a 32-digit hexadecimal number, for the attachment. String
Created Date Time Date and time when the attachment was uploaded. For example, 2019-05-21 04:12:21. Date & Time
Updated Date Time Date and time when the attachment was last updated. For example, 2019-06-15 09:05:43. Date & Time

Typical use case for the Upload Attachment card

To use the Upload Attachment card successfully in a flow, perform the following steps:

  1. In your ServiceNow instance, create an incident.

  2. Identify the system ID for the table to which you want to attach a file.

  3. On the Upload Attachment card, for the file that you want to attach to a ServiceNow incident, map it from the Workflows file system to the File Content field.

  4. Assign a name in the File Name field.

  5. In the Table Name field, enter Incident.

  6. Enter the system ID for the ServiceNow table in the Table System ID field.

The specified file is uploaded to the ServiceNow incident as an attachment.

Caution

If you enter a value in the Table Name field that doesn't exist, then the following will take place:

  • A record will be created in the sys_attachment table.

  • A new incident will be created in the incident table.

ServiceNow settings

In your ServiceNow instance, the following settings may limit the performance of the Upload Attachment card:

  • REST Attachment API request timeout: Search for transaction quota to find this setting. If the timeout value is set too low, then the API returns a timeout error.

  • Maximum file attachment size in megabytes: Search for attachment limits. The default limit is usually 1024 MB. While you can change this setting, the size of a file in the Workflows file system will not be larger than 2 GB. See Workflows system limits.

Related topics

ServiceNow connector

About the elements of Okta Workflows

ServiceNow Reference