activities
latest
false
UiPath logo, featuring letters U and I in white

Integration Service Activities

Last updated Feb 4, 2025

Technical references

This section includes useful information you may require when interacting with ServiceNow activities.

How to query all attachments of an incident

This guide explains who to query the attachments of an incident using a List All Attachments activity.

In ServiceNow, the sys_attachment table stores the information of all attachments for all tables (incidents, tasks, requisition items, catalog items, etc.). To filter results, you must provide the table_name and the sys_id using the where clause.
Note: If you don't specify both the table_name_name and the sys_id, the List All Attachments activity returns all attachments for all tables.

The following examples shows how to use the List All Attachments activity with a filter to retrieve the file name of a specific attachment.

  1. Add a ServiceNow Get Record activity to your workflow.
  2. For the Select object field, select Incident.
    The Get Record activity outputs an Incident object. This allows you to later retrieve the sys_id of the incidents table.
  3. Add a List All Attachments activity.
  4. Set up a filter using the Where field. Configure the following conditions:
    1. "Table sys ID Equals Incident Sys Id". To retrieve the Incident Sys Id:
      • Select Use variable, select the Incident output object of Get Record.
      • Use the dropdown properties list to find the sys_id property.
      • Alternatively, you can use the Expression editor to type incident.sys_id.
        Figure 1. Retrieving the sys_id from the Incident output object
        Retrieving the sys_id from the Incident output object

    2. "Table name Equals <incident>".
  5. Next, add a Log Message activity. For the Message field:
    1. Select Use variable and select the output of List All Attachments.
    2. Use the dropdown properties list to select the file_name property.
      Figure 2. Retrieving the file name of an attachment using the Attachments output object
      Retrieving the file name of an attachment using the Attachments output object

  • How to query all attachments of an incident

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2025 UiPath. All rights reserved.