folderid in parents not working anymore

109 views
Skip to first unread message

N2Z2

unread,
Nov 19, 2020, 10:07:45 AM11/19/20
to Google Apps Script Community
Hi all,
I've a google script with this call

"(title contains '" + searchQuery + "' or fullText contains '" + searchQuery + "') and '<?= e.parameter.folderid ?>' in parents and trashed != true";

This script runs over a google drive folder, searchQuery is the field to search, like dog or cat, e.parameter.folderid is the folder where I'm searching for files.

This script has worked well, but one day it has started to return no data. If I remove the "folderid" parameter I can find all files, but not just in that folder.

Drive API is v.2

Any hint on this?

Thanks

Alan Wells

unread,
Nov 19, 2020, 10:22:13 AM11/19/20
to Google Apps Script Community
The first thing I'd do is "hard code" the folder ID and determine if the code works or fails with a known good folder ID.
If you are using the "built-in" Advanced Drive Service, then the only version available is v2.
If something happened at Google that created a bug, then you'd need to rework your code somehow.

Andrew Roberts

unread,
Nov 19, 2020, 10:27:48 AM11/19/20
to google-apps-sc...@googlegroups.com
This is probably something to do with Google introducing file shortcuts, and how files and folders can now only have a single parent, all other references are now shortcuts. You may need to re-work your code to accommodate that.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/ed5cb114-d8aa-4b1a-8c7e-a0baea89a8b0n%40googlegroups.com.

N2Z2

unread,
Nov 19, 2020, 11:26:47 AM11/19/20
to Google Apps Script Community
I've already done this test, and It doens't work..

N2Z2

unread,
Nov 19, 2020, 11:27:50 AM11/19/20
to Google Apps Script Community
That's disappointing.. but it does make sense.. I'll give it a try, thanks
Reply all
Reply to author
Forward
0 new messages