如何为searchFolders()函数正确使用Google App脚本“ not”查询运算符

时间:2019-09-11 19:21:36

标签: javascript google-apps-script google-drive-api

我正在尝试通过共享驱动器搜索名称中不包含“已存档”的KPI报告。但我收到“无效参数:q”错误

我尝试使用“标题不包含“已存档””和“标题不包含“已存档””

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

1 个答案:

答案 0 :(得分:1)

只需将“和”放在“非标题”之前!归功于@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'");