Info_Attachments
Query Smartsheet Attachments. Attachments can exist on a Comment (i.e., within a Discussion), on a Row, or on a Sheet.
Table Specific Information
Select
When getting data from this table the queries might be slow if you have a lot of sheets. To counter this, specifying SheetId is recommended. Also other parameters like DiscussionId, RowId, CommentId can be specified to get Attachments to the related object.
Retrieve all Attachments from all Sheets.
SELECT * FROM Info_Attachments
Retrieve all Attachments related to a Sheet.
SELECT * FROM Info_Attachments WHERE SheetId = '2940085806098308'
Retrieve all Attachments related to a discussion.
SELECT * FROM Info_Attachments WHERE SHEETId = '2940085806098308' AND DiscussionId = '8206230771525508'
Retrieve all Attachments related to a Row.
SELECT * FROM Info_Attachments WHERE SheetId = '2940085806098308' AND RowId = '6773684447799172'
Retrieve all Attachments related to a Comment.
SELECT * FROM Info_Attachments WHERE SheetId = '2940085806098308' AND CommentId = '1322606759569284'
Retrieve details of a specific Attachment.
SELECT * FROM Info_Attachments WHERE Id = '3053958945105796' AND SheetId = '2940085806098308'
Insert
You can attach a file to a specific row in a specific sheet. Fields required for Insert are SheetId, RowId, Name of the file and either FilePath or ContentEncoded.
INSERT INTO Info_Attachments (SheetId, RowId, Name, FilePath) VALUES ('8179839304787844', '4728727909230468', 'TestSheet.xlsx', 'G:\\\\TestSheet.xlsx') INSERT INTO Info_Attachments (SheetId, RowId, Name, ContentEncoded) VALUES ('8179839304787844', '4728727909230468', 'TestSheet.xlsx', 'dGVzdGluZyBlbmNvZGVkIHRleHQ=')
Columns
Name | Type | ReadOnly | References | Description |
Id [KEY] | String | False |
The unique Identifier of the attachment. | |
Name | String | False |
The name of the attachment. | |
Url | String | False |
The temporary URL of the attachment (files only). | |
UrlExpiresInMillis | Long | False |
The temporary URL time to live for the attachment (files only). | |
AttachmentType | String | False |
The attachment type (one of FILE, GOOGLE_DRIVE, LINK, BOX_COM, DROPBOX, EVERNOTE, or EGNYTE). | |
AttachmentSubType | String | False |
The attachment subtype, valId only for either GOOGLE_DRIVE attachments or EGNYTE attachments. Possible values for GOOGLE_DRIVE attachments: DOCUMENT, SPREADSHEET, PRESENTATION, PDF, DRAWING. Possible values for EGNYTE attachments: FOLDER. | |
CreatedAt | Timestamp | False |
A timestamp of when the attachment was originally added | |
UserId | String | False |
The Id of the user who created the attachment. | |
UserEmail | String | False |
The email address of the user. | |
UserName | String | False |
The full name of the user. Read-only. | |
MimeType | String | False |
Attachment MIME type. For example PNG. | |
ParentType | String | False |
The type of object the attachment belongs to. Possible values: SHEET, ROW, or COMMENT. | |
ParentId | String | False |
The Id of the parent. | |
SizeInKb | Long | False |
The size of the file, if the attachmentType is FILE. | |
SheetId | String | False |
The Id of the sheet. | |
RowId | String | False |
The Id of the row. | |
DiscussionId | String | False |
The Id of the discussion. | |
CommentId | String | False |
The Id of the comment. | |
FilePath | String | False |
The path of the file to insert. | |
ContentEncoded | String | False |
BASE64 encoded content of the file to insert. |