drive.files.list query on properties not working
trying to do a search for files with specific custom property which I have successfully set and and can see the properties array if I cheat an get the file directly (knowing its id)
the q below is not working get 400 error "Invalid query"
var args = {
corpus: "DEFAULT",
maxResults: 10,
q: "properties has { key='ufn' }"
};
drive.files.list(args, function(err, rd){
if(err){
return cb(err, null);
}
return cb(null, rd);
});
also if I follow the documentation at : https://developers.google.com/drive/web/search-parameters#properties
and try and use a q like:
"properties has { key='ufn' and value='8e8aceg2af2ge72e78' and visibility='PRIVATE' }" gives same error.
Is documentation correct because it does not work in web interface either.
any help appreciated
I had the same issuse and solved it. Post it here even after a year, in case anybody need it. You need to specify key and value at the same time , NO VISIBILITY. You can search by appProperties as well.
properties has { key='customKeyA' and value='customKeyAValue2'}
(Marking this as closed due to staleness - @djholly123 feel free to reopen if this is still a problem for you. Thanks!)
Hi, It's working for me. This gives a result when we give the exact key and value. how to do contains check. Example: A file has properties key is "FileKey" and value is "FileValue" I give the search value like "File". How to get the file
Greetings @Vigneshwaran22! If you're running into trouble, please file a new issue complete with a code sample, the version of the module you're using, and any other details. Thanks!