Page 1 of 2

using the "Where" in distinct query

Posted: Sun Feb 08, 2015 4:07 pm
by Spark Chao

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!!


using the "Where" in distinct query

Posted: Sun Feb 08, 2015 6:46 pm
by M&M

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


using the "Where" in distinct query

Posted: Mon Feb 09, 2015 5:27 am
by Yurii Orishchuk

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.


using the "Where" in distinct query

Posted: Mon Feb 09, 2015 5:34 am
by Spark Chao

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


using the "Where" in distinct query

Posted: Mon Feb 09, 2015 7:03 am
by Spark Chao

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


using the "Where" in distinct query

Posted: Mon Feb 09, 2015 11:26 am
by Spark Chao

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


using the "Where" in distinct query

Posted: Tue Feb 10, 2015 3:52 am
by Yurii Orishchuk

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.


using the "Where" in distinct query

Posted: Tue Feb 10, 2015 7:33 am
by Spark Chao

1、settings
Image

2、Request Headers
Image

3、Request Query String
Image

4、Response Body
Image

5、test
Image


using the "Where" in distinct query

Posted: Tue Feb 10, 2015 9:33 am
by M&M

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


using the "Where" in distinct query

Posted: Wed Feb 11, 2015 5:41 am
by Yurii Orishchuk

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.