Get Attachment
The Get Attachment action retrieves the actual file content of an attachment in one step using the attachment’s ID. Normally this takes multiple actions in Power Automate, but this action condenses it to 1.
When to use this
Any time a flow needs to actually download a file that’s attached to a Smartsheet row or sheet.
Need this action in your flow?
Get this action plus 6 others and ready-to-use sample flows with the toolkit.
Parameters
| Parameter | Required | Description |
|---|---|---|
sheetId | Required | The ID of the sheet containing the attachment. |
attachmentId | Required | The ID of the attachment to retrieve. |
Using sheetId
This can be a fixed, hardcoded value taken from the properties of a sheet in Smartsheet, but it is very common to get the sheetId dynamically from a trigger or another action.
Using attachmentId
The ID that Smartsheet assigns to each attachment. It comes from the attachments array in Get Row or Get Sheet response and each attachment there has its own id.
Before you call this action
This action only works on attachments of type FILE. Other attachment types such as a link, a Google Drive file, a Box file, or a Dropbox file don’t have file content to download in the same way, and calling this action on one of them returns an error.
The suggested use: call Get Row or Get Sheet (Advanced) first with include set to attachments, then check each attachment’s attachmentType before deciding what to do:
- If
attachmentTypeisFILE, then call this action to get the actual file content. - If it’s anything else (LINK, GOOGLE_DRIVE, BOX_COM, DROPBOX, EGNYTE), then don’t call this action at all. Get Row already gave you the
urlfield directly on that attachment, which is everything you need.
Example
A flow that triggers on a new row being added, checks its attachments with Get Row, and automatically saves any FILE-type attachment to a SharePoint document library.
What you get back
The raw file content itself, ready to save, email, or process in a later step. You will not get a JSON object describing the file, the file itself. For file metadata, you can get that from the action that provides you with the attachment’s id.
If there’s an error instead
Instead of a file, you’ll get a JSON object with these keys:
| Key | Description |
|---|---|
refId | Error occurrence ID, useful if you need to contact Smartsheet support. |
errorCode | e.g. NOT_A_FILE_ATTACHMENT. |
message | Descriptive error message. |
attachmentType | The attachment’s actual type. Present when the error is NOT_A_FILE_ATTACHMENT. |
url | The attachment’s own URL. Present when the error is NOT_A_FILE_ATTACHMENT — use this instead of calling this action again. |
For example, to email yourself the error message: set Configure run after on the email action to include “has failed,” then reference the field with an expression since these fields don’t appear in the dynamic content picker (see Gotchas below):
outputs('Get_Attachment')['body']['message']
Get_Attachment in that expression is the action’s internal name, generated from whatever you’ve named the step (spaces become underscores). If you’ve renamed this step, swap in your own step’s name.
Gotchas
Calling this on a non-FILE attachment returns an error and that error includes the attachment’s own attachmentType and url right in the error body, so you can recover from it without an extra lookup. Still, the cleanest approach is checking attachmentType from Get Row first, so your flow never hits this error path at all.
The error fields (see “If there’s an error instead” above) won’t show up in the dynamic content picker because Power Automate only builds picker tokens from an action’s success response, not its error response. Reference them with an expression instead, as shown above.
Need this action in your flow?
Get this action plus 6 others and ready-to-use sample flows with the toolkit.
