Get parent folder ID of a file by file ID in Google Drive

Hello everyone,

I want to get the ID of a folder in GDrive that contains the file with a specific file ID. I get the file ID in the scenario via a webhook. Now I only need the folder ID. I have added a ‘Search for Files/Folders’ module for this. I have tried to get the file and especially the ‘Parents’ of the file via the query, because I hope that the folder ID will also be supplied there. However, I get a 400-Eroor (probably because the query is syntactically wrong?) and I wonder in general whether this is the optimal way to get the folder ID.

I look forward to feedback.

Hello there,

Use the Make an API Call module and set it as below

1 Like

Use the Get a Folder module in make.com. it returns all metadata about any Google drive folder.

Works perfectly. Thank you. How can I also get the name of the file. Do I have to set a new API call or is it possible to do this in the same module? (Add an item 2 with the key “fields” and the value “name” doesn’t work, but maybe I don’t understand the Drive API correctly).

Don’t add an item.

For key = fields
Value = parents, name

1 Like