ServiceNow get attachment action

Use the Get Attachment action to download a new attachment from the specified record in a ServiceNow Table app.

Prerequisites

Ensure that you are authenticated before initiating any ServiceNow action. For more details, see ServiceNow authentication action.

Procedure

  1. From the Actions pane, select ServiceNow > Attachments > Get Attachment and place it in the canvas.
  2. Specify details in the following fields:
    1. Filter attachment by.
      • Sys_id: Specify the attachment ID or select a variable where the attachment ID is stored.
      • Associated record: Specify details of the associated record, to download the associated attachment. You must enter the table name and the table ID.
      • Query: Specify a query parameter to download the attachments. For example, you can map the sys_id to a variable and add it as a query.
    2. Enter a Destination folder path, or select a variable if the path is stored in a variable.
    3. The session name displays as Default.
    4. You can assign the attachment ID to a string variable. For example, the attachment ID is saved to list_GetAttachmentResults.

      Get record action for service now
  3. Click Run to save and run your bot.
  4. The attachment is downloaded to the specified folder path.
    Note: The output is retrieved as a list of type Dictionary. To read an individual record (row) in this list, you need to loop through all the dictionary items using the Loop action and read or extract the records (rows) individually. For example, the output of get multiple records is saved in the variable list_of_records_any. If the variable contains five records, then each record is passed to the Loop action to be processed one at a time.Loop action for get multiple records