Hi, everyone.
I have been trying to use Google Drive API for getting a list with the action items assigned in all files (docs or spreadsheets) in my company's domain using Spring Boot and the google-api-services-drive
, but I have faced some issues:
indexableText
property, but it is not present on the response.fullText
field not available in the response, or some other equivalent attribute to see the actual content and use it as a workaround to get the action items?I just need to know who was assigned to the action item from the comment.
Any ideas?
Goto the same Google Sheets File and refresh the page. Then you will get the "List Files/Folders" menu, click on it, and select the "List All Files and Folders" item.
At the bottom of the advanced search box, there is an dropdown menu for Follow up. Select Action Items Only from the Follow up menu, and click Search. You will see a list of all the documents where you've been assigned action items in one place.
fields
as comments/replies/action
I agree with you that it is not straightfoward, but there is a way to retrieve the full comment content including action items.
Use Files:list specifying q
as fullText contains 'followup:actionitems'
, just as in the post you mentioned
For each of the retrieve items, use the fileId
for the method Comments: list
fields
for Comments:list
as *
- this will return you the complete reponse looking as following:{
"kind": "drive#commentList",
"comments": [
{
"kind": "drive#comment",
"id": "AAAAGlyxwAg",
"createdTime": "2020-06-08T09:04:34.907Z",
"modifiedTime": "2020-06-08T09:05:07.279Z",
"author": {
"kind": "drive#user",
"displayName": "XXX",
"photoLink": "//ssl.gstatic.com/s2/profiles/images/silhouette96.png",
"me": true
},
"htmlContent": "+\u003ca href=\"mailto:[email protected]\" data-rawHref=\"mailto:[email protected]\" target=\"_blank\"\[email protected]\u003c/a\u003e Could you please check the spelling?",
"content": "[email protected] Could you please check the spelling?",
"deleted": false,
"resolved": true,
"quotedFileContent": {
"mimeType": "text/html",
"value": "Hello"
},
"anchor": "kix.94ksxclyqix",
"replies": [
{
"kind": "drive#reply",
"id": "AAAAGlyxwAo",
"createdTime": "2020-06-08T09:05:02.999Z",
"modifiedTime": "2020-06-08T09:05:02.999Z",
"author": {
"kind": "drive#user",
"displayName": "YYY",
"photoLink": "//ssl.gstatic.com/s2/profiles/images/silhouette96.png",
"me": false
},
"htmlContent": "Will do!",
"content": "Will do!",
"deleted": false
},
{
"kind": "drive#reply",
"id": "AAAAGlyxwAs",
"createdTime": "2020-06-08T09:05:07.279Z",
"modifiedTime": "2020-06-08T09:05:07.279Z",
"author": {
"kind": "drive#user",
"displayName": "YYY",
"photoLink": "//ssl.gstatic.com/s2/profiles/images/silhouette96.png",
"me": false
},
"deleted": false,
"action": "resolve"
}
]
}
]
}
This response contains the following information:
action
is a resources nested in comments/replies
action
, replace the *
in fields
with comments/replies/action
as for your question about indexableText
, the documentation specifies that it is a property of contentHints
and
contentHints
Additional information about the content of the file.
These fields are never populated in responses.
A way to make indexableText
"useful" is e.g. apply it in queries like
Files:list
with q
: fullText contains 'indexableText'
The good new are that if you not happy with the way how actions are retrieved now and can think of a better method to implement it, you can file a Feature request on Google's Public Issue Tracker. If enough users show interest in the feature, Google might implement it in the future.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With