Forum Discussion

Lindsey's avatar
Lindsey
Leader
6 years ago

Can I use keyword "or" in API browser?

When I search:
select id from messages where labels.text='Nursing'
the API browser returns 3 results.
When I search:
select id from messages where labels.text='Project Manager'
the API browser returns 2 results.
However, when I search:
 select id from messages where labels.text='Project Manager' or labels.text='Nursing'
0 results are returned. Not an error message, just 0 results.

Am I doing something wrong? Is there not the ability to search with the keyword "or"? I don't understand how I am getting these results.

  • Lindsey 

    Here OR is also working as AND and I have seen the same issue in Match query also. 
    But you can pass multiple labels using IN query. 

    select id from messages where labels.text IN ('Label1', 'Label2')

     

  • Lindsey 

    Here OR is also working as AND and I have seen the same issue in Match query also. 
    But you can pass multiple labels using IN query. 

    select id from messages where labels.text IN ('Label1', 'Label2')

     

  • Hi Lindsey

    I am not 100% sure but I am aware that on the API V1 / V2 search page there is one line that states "OR works like AND in LiQL at this time". But I am not able to find any other mention of this any where. I am not saying this is true for every part of the API V2 but I would love to know more in for if someone has it.

     

    Related Links:

    https😕/community.khoros.com/t5/short/link/m-p/39942