DownloadAttachment
Downloads attachments related to a specific Salesforce entity.
Input
| Name | Type | Description |
| ObjectId | String | ID of the Salesforce object (such as Account or Case) to which the attachment is related. Used to retrieve attachments associated with this object. |
| Id | String | ID of the specific attachment to download. Required if Name is not provided. If both Id and Name are omitted, all attachments related to the ObjectId will be downloaded. |
| Name | String | Filename of the attachment to download. Used as an alternative to Id when LightningMode is 'false'. If both Name and Id are omitted, all attachments for the ObjectId will be downloaded. |
| LocalPath | String | Directory path on your local machine where the attachment will be saved. If not provided, the attachment will be returned in memory via FileData. |
| LightningMode | String | Set to 'true' to download from the Lightning Experience 'Salesforce Files' system instead of Classic Attachments. Required if the file was uploaded using UploadAttachment with LightningMode enabled. |
| Encoding | String | Character encoding used to return the file data in the FileData output. Applies only when the file is not saved to a local path.
The allowed values are NONE, BASE64. The default value is BASE64. |
Result Set Columns
| Name | Type | Description |
| FileId | String | Salesforce ID of the downloaded file. |
| Success | String | Indicates whether the attachment was downloaded successfully (true) or not (false). |
| FileName | String | Name of the downloaded file, as stored in Salesforce. |
| FullPath | String | Full local path, including filename, where the attachment was saved. Returned only if LocalPath was specified. |
| FileData | String | Base64-encoded file content, returned only if the file was not saved to disk (LocalPath not specified). |
| FailureMessage | String | If multiple files were downloaded, this field includes error messages for any files that failed to download. |