Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!