This topic was automatically generated from Slack. You can find the original thread here.
Hey guys, im creating a trigger for google drive docs, but when I receive the event, how can I Read the docs content ?
This topic was automatically generated from Slack. You can find the original thread here.
Hey guys, im creating a trigger for google drive docs, but when I receive the event, how can I Read the docs content ?
Which source are you using? Are you using “New Document Created” or “New or Updated Document” sources in your workflow Google Docs API Integrations - Pipedream?
Or are you building a custom component (not reusing a pre-built component?
Im using New or Updated Document
You can read your document contents via the steps variable, look for your_step_name.event.body.content property
The content property gives you a break down of the document, for example, in the test I use in the screenshot, my document has a section with that includes the text "The submit-an-app UI was recently":
In my case, I am using a workflow with the New or Updated Document source from Google Docs app as the trigger, this step is named “trigger”, hence I am accessing steps.trigger in the upper, red circled variable.
Apparently, google docs will return an array in the contents property where each element is like a section title or paragraph.
Does this give you good guidance?
I can use the your_step_name.event.body.content property in downstream steps in my workflow like this. And that’s the idea
apparently I did not received this on my json body webhook
mmm… I’d double check the Google Docs account connected owns or has shared access to the document you want triggers to be emitted from. I deployed my workflow and it’s working as expected, it has the expected json body:
{
“file”: {
“kind”: “drive#file”,
“id”: “1JfjHqGip-JvpKNM__nXJYpYW2D_E3qV-”,
“name”: “Pagamentos por jurisdição e esfera governamental 2024.pdf”,
“mimeType”: “application/pdf”,
“parents”: [
“1RYKoq2arnOvfI85HThQ1O8D-5GR3ZCqy”
]
},
“changes”: [
{
“file”: {
“parents”: [
“1RYKoq2arnOvfI85HThQ1O8D-5GR3ZCqy”
],
“lastModifyingUser”: {
“displayName”: “Gabriel Moreira”,
“kind”: “drive#user”,
“me”: true,
“permissionId”: “05176359892631351345”,
“emailAddress”: “gmoreira1santos@gmail.com”,
“photoLink”: “https://lh3.googleusercontent.com/a/ACg8ocLNFUrbM-1bHY2e4rdm5ONBS6kin3xwe5CPwqw7m69o5RBHcQ=s64”
},
“owners”: [
{
“displayName”: “Gabriel Moreira”,
“kind”: “drive#user”,
“me”: true,
“permissionId”: “05176359892631351345”,
“emailAddress”: “gmoreira1santos@gmail.com”,
“photoLink”: “https://lh3.googleusercontent.com/a/ACg8ocLNFUrbM-1bHY2e4rdm5ONBS6kin3xwe5CPwqw7m69o5RBHcQ=s64”
}
],
“permissions”: [
{
“kind”: “drive#permission”,
“id”: “05176359892631351345”,
“type”: “user”,
“emailAddress”: “gmoreira1santos@gmail.com”,
“role”: “owner”,
“displayName”: “Gabriel Moreira”,
“photoLink”: “https://lh3.googleusercontent.com/a/ACg8ocLNFUrbM-1bHY2e4rdm5ONBS6kin3xwe5CPwqw7m69o5RBHcQ=s64”,
“deleted”: false,
“pendingOwner”: false
}
],
“spaces”: [
“drive”
],
“capabilities”: {
“canAcceptOwnership”: false,
“canAddChildren”: false,
“canAddMyDriveParent”: false,
“canChangeCopyRequiresWriterPermission”: true,
“canChangeItemDownloadRestriction”: true,
“canChangeSecurityUpdateEnabled”: false,
“canChangeViewersCanCopyContent”: true,
“canComment”: true,
“canCopy”: true,
“canDelete”: true,
“canDisableInheritedPermissions”: false,
“canDownload”: true,
“canEdit”: true,
“canEnableInheritedPermissions”: true,
“canListChildren”: false,
“canModifyContent”: true,
“canModifyContentRestriction”: true,
“canModifyEditorContentRestriction”: true,
“canModifyOwnerContentRestriction”: true,
“canModifyLabels”: false,
“canMoveChildrenWithinDrive”: false,
“canMoveItemIntoTeamDrive”: true,
“canMoveItemOutOfDrive”: true,
“canMoveItemWithinDrive”: true,
“canReadLabels”: false,
“canReadRevisions”: true,
“canRemoveChildren”: false,
“canRemoveContentRestriction”: false,
“canRemoveMyDriveParent”: true,
“canRename”: true,
“canShare”: true,
“canTrash”: true,
“canUntrash”: true
},
“permissionIds”: [
“05176359892631351345”
],
“linkShareMetadata”: {
“securityUpdateEligible”: false,
“securityUpdateEnabled”: true
},
“downloadRestrictions”: {
“itemDownloadRestriction”: {
“restrictedForReaders”: false,
“restrictedForWriters”: false
},
“effectiveDownloadRestrictionWithContext”: {
“restrictedForReaders”: false,
“restrictedForWriters”: false
}
},
“kind”: “drive#file”,
“id”: “1JfjHqGip-JvpKNM__nXJYpYW2D_E3qV-”,
“name”: “Pagamentos por jurisdição e esfera governamental 2024.pdf”,
“mimeType”: “application/pdf”,
“starred”: false,
“trashed”: false,
“explicitlyTrashed”: false,
“version”: “10”,
“webContentLink”: “erhttps://drive.google.com/uc?id=1JfjHqGip-JvpKNM__nXJYpYW2D_E3qV-&export=download”,
“webViewLink”: “https://drive.google.com/file/d/1JfjHqGip-JvpKNM__nXJYpYW2D_E3qV-/view?usp=drivesdk”,
“iconLink”: “https://drive-thirdparty.googleusercontent.com/16/type/application/pdf”,
“hasThumbnail”: true,
“thumbnailLink”: “https://lh3.googleusercontent.com/drive-storage/AJQWtBOWabmT-ExgkQDZX1CY6oqB3R_5JpU5tt7VeA6-1UUuyw0KUuaT7oS4FOJQIZHpQkC9tbYl5QvlctVX7XUjGdE2GcNtsKRblwUhAMDPrfIjSkML=s220”,
“thumbnailVersion”: “5”,
“viewedByMe”: true,
“viewedByMeTime”: “2026-01-20T20:32:09.852Z”,
“createdTime”: “2026-01-20T19:22:51.629Z”,
“modifiedTime”: “2026-01-20T20:32:09.852Z”,
“modifiedByMeTime”: “2026-01-20T20:32:09.852Z”,
“modifiedByMe”: true,
“shared”: false,
“ownedByMe”: true,
“viewersCanCopyContent”: true,
“copyRequiresWriterPermission”: false,
“writersCanShare”: true,
“originalFilename”: “Pagamentos por jurisdição e esfera governamental 2024.pdf”,
“fullFileExtension”: “pdf”,
“fileExtension”: “pdf”,
“md5Checksum”: “0dd08de57ce8f6e76e5f0dee0a6f758f”,
“sha1Checksum”: “16bdd2de1dd6892c027a3f2d4c7679c3af1b8d33”,
“sha256Checksum”: “466746dfb3472a1de42e24b8d208f18e3a890d15865665d5cbc85b6676822a17”,
“size”: “199920”,
“quotaBytesUsed”: “599760”,
“headRevisionId”: “0ByPNNCdZz_JSRFQwSXpVZHp6SmxEUDA1L0JXUHpFTUZIRmJBPQ”,
“isAppAuthorized”: false,
“inheritedPermissionsDisabled”: false
},
“kind”: “drive#change”,
“type”: “file”,
“changeType”: “file”,
“time”: “2026-01-20T20:32:12.297Z”,
“removed”: false,
“fileId”: “1JfjHqGip-JvpKNM__nXJYpYW2D_E3qV-”
}
],
“kind”: “drive#changeList”,
“newStartPageToken”: “44010”,
“change”: {
“state”: “change”,
“resourceURI”: “gihttps://www.googleapis.com/drive/v3/changes?alt=json&pageToken=43977”
}
}
@URV1X5N2H make sense ?
yes. That payload looks more of a Google Drive source such as “changes to files in Drive” or “Changes to specific files from Drive” https://pipedream.com/apps/google-drive#popular-google-drive-triggers
Based on the analysis on the payload that you provided, the file contents are not provided.
I think you should use one of the URLs from the payload such as webContentLink.
You can use the Dowload File to /tmp with Pipedream utils Helper Functions - Download File To /tmp - Pipedream to get contents.
You can use other apps to convert from PDF to HTML such as HTML 2 PDF API Integrations - Pipedream, there might be other apps to convert PDF to Word, or other formats, such as Cloud Convert https://pipedream.com/apps/cloud-convert Convert Files API | CloudConvert
IN summary, you are only getting a link to the file that changed, you’ll need to pull its contents using the link provided by the webhook or source payload
Is there a trigger that send me a summary of the file ?
a quick look at Google Drive sources reveal that sources don’t provide a summary of the files in the event