Zapier doesn't have an action to delete files in Google Drive. Would it be possible to achieve this using Code?
Deleting files in Google Drive
Best answer by Metagrate_John4man
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!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.