Comments
Returns comments on a file.
Id Encoding
The Google Drive API uses case-sensitive IDs for comments, meaning IDs like "AAABpKTbnsw" and "AAABpKTbnSw" are considered unique. Since the connector is case-insensitive, the Id column contains an encoded numeric representation of the original API ID. This encoding converts the case-sensitive ID into a unique base-10 number string that can be safely used in queries while maintaining uniqueness.
The OriginalCommentId column contains the original, case-sensitive Google Drive API ID.
Select
The Comments table supports the following columns for filtering. The connector uses the Google Drive API to process WHERE clause conditions built with these columns, offering optimal performance.
| Column | Supported Operators |
| Id | = |
| FileId | = |
When specifying FileId, the filter is sent server-side for better performance:
SELECT * FROM Comments WHERE FileId = '19YFv8wmvKixCYaJJAeE8jN3ROt7x1ZicvXwflswVOrw'
You can also filter by Id to retrieve a specific comment:
SELECT * FROM Comments WHERE FileId = '1eCy_Fks57HytPuam-OiaHGY4_15Py16eVM5bNDCHYXQ' AND Id = '21454749864264944795'
To include deleted comments in the results, use the IncludeDeleted pseudo-column:
SELECT * FROM Comments WHERE FileId = '19YFv8wmvKixCYaJJAeE8jN3ROt7x1ZicvXwflswVOrw' AND IncludeDeleted = true
Insert
To insert a comment, you must specify at least the FileId and Content fields:
INSERT INTO Comments (FileId, Content) VALUES ('19YFv8wmvKixCYaJJAeE8jN3ROt7x1ZicvXwflswVOrw', 'This is a comment on the file')
Update
To update a comment, specify the Id along with the fields to modify:
UPDATE Comments SET Content = 'Updated comment content' WHERE Id = '21454749864264944795' AND FileId = '19YFv8wmvKixCYaJJAeE8jN3ROt7x1ZicvXwflswVOrw'
Delete
To delete a comment, specify the Id:
DELETE FROM Comments WHERE Id = '21454749864264944795' AND FileId = '19YFv8wmvKixCYaJJAeE8jN3ROt7x1ZicvXwflswVOrw'
Columns
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
The unique identifier of the comment. |
| FileId [KEY] | String | False |
The unique identifier of the file. |
| CreatedTime | Datetime | True |
The time at which the comment was created. |
| ModifiedTime | Datetime | True |
The last time the comment or any of its replies was modified. |
| Replies | Object | True |
The full list of replies to the comment in chronological order. |
| Resolved | String | True |
Whether the comment has been resolved by one of its replies. |
| Anchor | String | False |
A region of the document represented as a JSON string. |
| Author | String | True |
The display name of the comment's author. |
| Deleted | Boolean | True |
Whether the comment has been deleted. A deleted comment has no content. |
| Content | String | False |
The plain text content of the comment. |
| HTMLContent | String | True |
The content of the comment with HTML formatting. |
| QuotedFileContentMimeType | String | True |
The MIME type of the quoted content. |
| QuotedFileContentValue | String | False |
The quoted content itself. This is interpreted as plain text if set through the API. |
| OriginalCommentId | String | True |
The original, case-sensitive Google Drive API Id of the comment. Used only for references. |
| Kind | String | True |
Identifies what kind of resource this is. Value: the fixed string 'drive#comment'. |
Pseudo-Columns
Pseudo-column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
| Name | Type | Description |
| IncludeDeleted | Boolean |
Whether to include deleted comments. Deleted comments will not include their original content. |