Spark Chao
Posts: 0
Joined: Sat Jan 17, 2015 6:25 am

using the "Where" in distinct query

my collection like below.
Image

I follow your tutorials to set the POST service and "where" parameter,also return the localstorage variables from previous page.
Image
Image
Image

If user select Asia,it will show country"Taiwan"、"Japan"、"Hongong" ,besides "Europe1".
did I set something wrong?
thanks!!

M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

using the "Where" in distinct query

You are querying right? Then your Method should be GET and not POST.

For testing use a hard coded value for where parameter and check the result. Once it is confirmed that it works, then substitute the variable or use the value from a UI / Input component

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

using the "Where" in distinct query

Hi Spark,

You have two solutions:

  1. Use "GET" method instead of "POST".

  2. If you want to use "POST" method - move "where" request parameter to "body" section of the request tab.

    Regards.

Spark Chao
Posts: 0
Joined: Sat Jan 17, 2015 6:25 am

using the "Where" in distinct query

Yurii
Thanks for your help!!!
I will try it later,and will let you know does it work!!!

Spark Chao
Posts: 0
Joined: Sat Jan 17, 2015 6:25 am

using the "Where" in distinct query

Yurii
Thanks for your help.
It is work!!
Image

Spark Chao
Posts: 0
Joined: Sat Jan 17, 2015 6:25 am

using the "Where" in distinct query

Yurii
I try it by " GET" way,it will show error message like below.
{
"status":400,
"uri":"https://api.appery.io/rest/1/db/colle...",
"response":{
"code":"BCXX002",
"description":"Cannot consume content type"
}
}

Image

One more thing need your help,when I gat the response value like Japan,can I also get another column's info of the same value?
Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

using the "Where" in distinct query

Hi Spark,

Please check if you have in "get" method in request-headers "content-type" header - delete it.

Also if you still have this problem show us your service all tabs screen shots.(request tab subtabs too).

Thanks.

Spark Chao
Posts: 0
Joined: Sat Jan 17, 2015 6:25 am

using the "Where" in distinct query

1、settings
Image

2、Request Headers
Image

3、Request Query String
Image

4、Response Body
Image

5、test
Image

M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

using the "Where" in distinct query

If you are testing it on your browser you need to enable appery proxy

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

using the "Where" in distinct query

Hi Spark,

Please follow this solution:

  1. Open service "request tab".

  2. Open "headers" subtab.

  3. Add there following parameter:

    Content-Type application/json

    Details: http://prntscr.com/63o6nb/direct

    Regards.

Return to “Issues”