简体   繁体   中英

How to properly use Google App Script “not” query operator for searchFolders() function

I am trying to to search through a shared drive for KPI reports that do not contain "Archived" in the name. But Im getting "Invalid argument: q" error

I have tried using "not title contains 'Archived'" and "title not contains 'Archived'"

var clientFolder = DriveApp.searchFiles("title contains 'KPI Report' and mimeType = 'application/vnd.google-apps.spreadsheet' and modifiedDate >= '" + dateModified + "' not title contains 'Archived'");

Simply had to put "and" before "not title"! Credit to @Chris G.!

var clientFolder = DriveApp.searchFiles("title contains 'KPI Report' and mimeType = 'application/vnd.google-apps.spreadsheet' and modifiedDate >= '" + dateModified + "' and not title contains 'Archived'");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM