Salesforce Download file attachment action

You can download a file from a record in Salesforce by using the Salesforce Download file attachment action.

Prerequisites

Note: Ensure that you are authenticated before calling any Salesforce action. For more information about authentication, see Salesforce Authentication action.

Procedure

  1. From the Actions pane, select Salesforce > Download file attachment and place it in the canvas.
  2. Enter the following fields:
    Salesforce Download File Attachment action
    1. Enter the Object's record ID from which you want to download the file. For example: '5004W000026rD4HQAU'
    2. Enter the Destination folder where you want to save the file.
    3. Set Download all files/filter by to one of the following options:
      All files: Download all the attached files from a record.
      File name: Download a file by entering a file name.
      File extension: Download all the files with the same extension that you enter.
      Content document ID: Download a particular version of a file.
    4. Enter Default as the session name.
    5. Save the outcome to a variable. For example, the details of the downloaded files can be saved in a variable, such as ListResponse
  3. To verify, you can run the bot and whether the file is downloaded to the specified location. The following video demonstrates how to download a file from Salesforce to a location on a local system.
    Note:
    • The file is downloaded from the ContentDocument Object.
    • File names are limited to 50 alphanumeric characters and any special characters are filtered when you download the file. The downloaded file name includes a document version ID that is appended before the file name, this ensures that the file name is unique. For example, if the file name is TEST_a_quick_brown_fox then the downloaded file name is 0684W00000c3OXFQA2-TEST_a_quick_brown_fox.
    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
    The output contains information such as document title, content document ID, file path, file extension, download status and error message if any of the downloaded file.