Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

How do I get the ID of a specifically named folder? #210

Open
Paulbraker opened this issue Nov 16, 2020 · 0 comments
Open

How do I get the ID of a specifically named folder? #210

Paulbraker opened this issue Nov 16, 2020 · 0 comments

Comments

@Paulbraker
Copy link

Paulbraker commented Nov 16, 2020

Ok so when the specific folder is not created I can create it, but If it exists I need the ID of the folder to work with it.
This is my code so far:

f = drive.ListFile({"q": "mimeType='application/vnd.google-apps.folder' and trashed=false"}).GetList()
    AllFolders = []
    for folder in f:
        AllFolders.append(folder['title'])

    

    if "Pythontesting1" not in AllFolders:
            folder_metadata = {'title' : 'Pythontesting1', 'mimeType' : 'application/vnd.google-apps.folder'}
            folder = drive.CreateFile(folder_metadata)
            folder.Upload()
    else:
        #What do I put here?
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant