Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drive.files.list query on properties not working #426

Closed
djholly123 opened this issue May 20, 2015 · 4 comments
Closed

drive.files.list query on properties not working #426

djholly123 opened this issue May 20, 2015 · 4 comments
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@djholly123
Copy link

djholly123 commented May 20, 2015

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

@raychenfj
Copy link

raychenfj commented Sep 7, 2016

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'}

@ace-n
Copy link
Contributor

ace-n commented Apr 14, 2017

(Marking this as closed due to staleness - @djholly123 feel free to reopen if this is still a problem for you. Thanks!)

@ace-n ace-n closed this as completed Apr 14, 2017
@Vigneshwaran22
Copy link

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

@JustinBeckwith
Copy link
Contributor

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!

@googleapis googleapis locked as resolved and limited conversation to collaborators Aug 13, 2019
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

6 participants