Zapier doesn't have an action to delete files in Google Drive. Would it be possible to achieve this using Code?
It seems as though it might be possible to do. The first challenge is to understand whether the Google Drive API permits deleting files. A cursory search of their API documentation yields a couple of results:
Files: update | Google Drive API
| Google Developers According to that page, the "update" method allows for the "Trashed" property to be modified. This appears to mean that a file can be placed in the trash via the API.
Files: delete | Google Drive API
| Google Developers The "delete" method skips the trash and permanently deletes the item. This is a bit more dangerous, for obvious reasons.
In either case, it appears that the user account which is used to authenticate to the Google Drive API must be the "owner" of the file in question. There are some other similar details to watch out for.
But these entries lead me to believe that since the Drive API permits these actions, they might be achievable via Code. The next challenge would be to sort out how to properly authenticate to the API. That is one of the more complex elements that is handled nicely by Zapier for the methods they support. It would take digging into this a bit more deeply to understand how difficult the authentication step would be.
I hope this helps!
Thanks a lot,
You're welcome,
Also: it just so happens that your timing is impeccable. I've just been tinkering with a custom Google Drive Integration to do a few things that the standard Zapier integration doesn't do. It wouldn't be difficult to add the functionality that you asked about. If you're interested in testing this for me, please PM me. Thanks!
Sure
The integration is private (invite-only) for now on the Zapier side of things, and it's untrusted/unverified at the moment from Google's side of things (which basically means Google throws a big warning on the consent screen when someone tries to authenticate with it), but I'm happy to share it with a few people if someone needs those functions—at least as long as we don't start bumping up against my quota with Google's API
Edit: Details on this integration here.
One area that is frustrating/lacking is the ability to "move a folder" or "rename a folder". I can't seem to find moving a folder anywhere in the Google Drive API docs, shockingly. Just the ability to move files.
Have been wondering this because we experience the same thing with Asana. No one is taking the reigns, so if we say built something, would we be able to monetize it direct to our customers, essentially a private Zapier integration? Because I'm guessing there's nearly a 0% chance that you'd ever allow something like this to be a "public" integration?
Thanks so much!
Alex
Hey
So, there is no way to take a private integration public through our platform unless the person building the integration/app is the owner of the API. Also, we don't allow anyone to sell access to an invite-only Zapier app in a public capacity, as it competes with our offering and may be confusing to users. Hope that helps to add some clarity!
Hey
Also: great question about public vs. private and monetization. Frankly, I can't have too many people using a custom integration that hits Google's APIs via my account because we'll start to hit some cost thresholds. But having a few people test it out and maybe make some recommendations about enhancements is certainly useful.
Thanks also,
Hey
Sorry I didn't catch this thread earlier! Any luck yet?
FWIW, the short answer is to your question is almost certainly. Anything you can do via API (e.g. via Postman) you should be able to do via the Code by Zapier (if that's what you meant by Code with a capital C.) But
Hey
Sorry I didn't catch this thread earlier, I don't know if this will still be helpful to you...
<Insert snarky GIF about preparing for something that will blow your mind>
The fundamental reason you can't "move a folder" or "rename a folder" in Google Drive API is they aren't really folders at all, they're essentially tags (with essentially a hidden part of the tag that represents the parentage.) But if you don't understand that folders are really tags, you can encounter a lot of strange and confusing things.
(FYI, I haven't tried this in a while, things may have changed, but I doubt it.)
For example, you delete a file from a folder. Did you delete the file? In a real folder yes. In google drive, you really just removed a tag. Some of these are addressed by the UI. For example, if you delete a file from a shared folder via the UI, google may warn you other users may also have that file in other folders (and provide instructions to really delete the file.) Wait, what? Do they mean a shortcut? Nope! In google drive, the exact same file, not duplicates or a shortcut, can exist in multiple folders... because they're not folders, they're tags.
So with this paradigm, "rename a folder" wouldn't be as simple as in a standard OS. Since it's really a tag, you have to find every file with that tag, remove that tag, and tag it with the name of the new "folder." (i don't remember if there was something specifically for "moving a file" , if so, that removing a tag and adding a new one is essentially what it's doing.)
In a standard OS, moving a folder is just changing it's parent. In google drive, moving a folder is essentially the same as "renaming a folder": once again, you have to find every file with that tag, remove that tag, and tag it with the name of the new "folder" ... which appears to be the same, but isn't, since it has a different hidden part of the tag that represents the parentage.
Hope the paradigm shift helps clarify things!
And... Wow... 🤯
That was incredibly helpful and insightful! Thank you so much for clarifying! So while it sucks that this doesn't seem possible in the current API, I now understand why it's so much more of a pain than I would typically expect it to be.
Thank you my friend! I'm seeing you a bunch here now! Glad to have you here!
Cheers!
Thank you,
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.