Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

192
Visualizações
with google files list how can I only show my owned folder instead of shared ones?

I only want to show my owned files when use the following code, but actually it list all the files even those share with me. how can I prevent this happen please

   gapi.client.drive.files
      .list({
        includeItemsFromAllDrives: false,
        supportsAllDrives: false,
        pageSize: 10,
        fields: 'nextPageToken, files(id, name, mimeType, modifiedTime)',
        q: searchTerm
      })
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The search term you should be using is owners. specifically the email address of the user how you are after as owner

'XXX@gmail.com' in owners

Or if you are looking for the currently authenticated user then use

'me' in owners

To find folders you would use the following which basically checks for the mime type of a folder.

mimeType = 'application/vnd.google-apps.folder'

Then to string them both together you just use and

Example

   gapi.client.drive.files
      .list({
        includeItemsFromAllDrives: false,
        supportsAllDrives: false,
        pageSize: 10,
        fields: 'nextPageToken, files(id, name, mimeType, modifiedTime)',
        q: ''me' in owners and mimeType = 'application/vnd.google-apps.folder''
      })

You need to fix the '' around the me im not very experienced with javascript sorry.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda