Reputation: 3567
I am working on a tool, and I want to query my own folders only. I can't formulate a query string that is accepted. I had read Search for files page, and I am experimenting now with the API explorer.
mimeType = 'application/vnd.google-apps.folder'
yields folders. Good start.ownedByMe
, ownedByMe = true
and ownedByMe = false
all yield error 400 (Invalid Value), while when I use this field in the result set, it is shown.sharedWithMe
, sharedWithMe = true
and sharedWithMe != false
yields result, but interestingly I can't add this field to the result set and neither is it included in the field selector. sharedWithMe = false
, not sharedWithMe
, not sharedWithMe = true
and sharedWithMe != true
all yield error 400 And I have tried some other less common syntaxes but now I am out of ideas :(
Upvotes: 1
Views: 677
Reputation: 3621
Use "[my email] in owners" or "'me' in owners":
var files = DriveApp.searchFolders("\(mimeType = 'application/vnd.google-apps.folder'\) and \('[email protected]' in owners\)");
var files = DriveApp.searchFolders("\(mimeType = 'application/vnd.google-apps.folder'\) and \('me' in owners\)");
Upvotes: 1