Attachment
Summarize
Summary of Attachment (Zurich Release)
The Attachment variable in ServiceNow’s Zurich release allows users to upload, download, update, and delete file attachments as part of catalog item requests. It supports managing attachments during request submission and fulfillment stages, enabling flexibility in handling files related to requested items and catalog tasks.
Show less
Key Features
- File Upload and Management: Users can upload attachments for catalog item questions, with options to download, update, or delete files both before and after request submission.
- File Size and Extension Restrictions: File size limits can be set using the
maxfilesizevariable attribute or the system propertyglide.sc.variable.attachment.defaultmaxsize(default 20 MB). The global limit defined bycom.glide.attachment.maxsizeapplies across the ServiceNow AI Platform. - Attachment Handling: Editing an attachment removes the existing file and uploads a new one. Attachments are stored in the Attachment [sysattachment] table but only committed upon item submission, cart addition, or record save.
- Attachment Copying Scenarios:
- In order guides, attachments are cascaded to catalog items but individual variable attributes (such as allowed file types) are initially ignored for cascaded attachments.
- In record producers, attachments map only to File Attachment fields in task tables.
- After copying, attachments are independent; changes to one do not affect others.
- API and Scripting Support: The
gform.setValue()API is supported in catalog client scripts for this variable. - Security and Performance: Attachments undergo system-wide antivirus checks on request submission or cart addition. Large attachments can impact system performance due to copying.
- Limitations: Not supported in multi-row variable sets or item variable assignment in order guides, but supported within flows, workflows, and condition builders.
Practical Implications for ServiceNow Customers
This variable enables you to collect and manage file attachments efficiently within service catalog requests, with control over file types and sizes to align with organizational policies. Understanding the behavior of attachment copying in order guides and record producers helps prevent confusion and ensures data consistency. The antivirus integration and size limits help maintain system security and performance. Additionally, scripting support allows customization of attachment handling in client-side processes.
When submitting a catalog item request, this variable lets you upload an attachment for a question of the item.
- You should specify only an integer value for the following:
- The max_file_size variable attribute
- The glide.sc.variable.attachment.default_max_size system property (catalog-level). The default value is 20.
- If the max_file_size variable attribute is not specified, the glide.sc.variable.attachment.default_max_size system property value is considered as the upper limit for the attachment file size.
- Irrespective of the file size allowed in the variable, the attachment file size cannot exceed the size specified in com.glide.attachment.max_size system property, which is applicable for attachments across ServiceNow AI Platform.
- The g_form.setValue() API is supported in catalog client scripts.
When you upload an attachment to this variable, an entry is created in the Attachment [sys_attachment] table. The variable is not updated until you submit the item request, add it to the cart, or save the record while editing it (in fulfiller flows). If you delete or update the attachment before submitting the corresponding catalog item, the entry in the Attachment [sys_attachment] table is cleared.
- In an order guide, when the variable is cascaded to a catalog item in the rule baseImportant:The individual variable attributes are not honored for the catalog items in the rule base. For example, let us consider that a variable in the Describe Needs section allows a .pdf attachment and the variable of a catalog item in the rule base allows a .txt attachment. When you upload an attachment of .pdf type for a variable in the Describe Needs section, it is initially cascaded to the variable in the catalog item as well and the variable attributes specified in the catalog item are not honored. However, if you delete this initially cascaded attachment from an individual item and try to upload a new attachment, then the individual variable attributes of the catalog item are honored.
- In a record producer, when the variable is mapped to a task table field. This variable can be mapped only to the File Attachment field type of a task table.
- Submit a request for the corresponding catalog item
- Add the catalog item to the cart or wish list
- This variable is not supported in a multi-row variable set.
- This variable is supported in flows and workflows.
- This variable is available in condition builder
- For this variable, item variable assignment is not supported in order guide.