Page 1 of 1

Appery.io and Azure Mobile Services - Cant filter in URI

Posted: Fri May 30, 2014 9:22 am
by Dave Shepherd

Hi All.

Please help. I am currently evaluating appery.io to use with our Azure Mobile Services and banging my head with one issue. If I don't get this to work we probably wont use appery.io as our development tool

I am trying to call a REST service exposed by WAMS using a filter.

What does work in appery:
Using a standard URI I get response results e.g.
http://mysite.azure-mobile.net/tables... --- returns all the content of the table and does populate a list on a appery.io page.

I am trying to filter on a Col in WAMS called assignedto

When try it in the appery.io - Service\Settings\URL and using the TEST function of the service:
http://mysite.azure-mobile.net/tables... eq 'Dave'
I get a response for all records assigned to Dave --- this is what I want
However it wont populate the list component and the seems to hang when loading a page.

I have also tried using a Request Parameter {assignedto} and used this in the URI
http://mysite.azure-mobile.net/tables... eq {assignedto}

You response will be greatly appreciated.

Dave


Appery.io and Azure Mobile Services - Cant filter in URI

Posted: Fri May 30, 2014 11:35 am
by Kateryna Grynko

Hi Dave,

It's better to leave URL= http://mysite.azure-mobile.net/tables...

Move the parameter $filter to request parameters and pass needed values there.

For this example http://msdn.microsoft.com/en-us/libra...
$filter parameter value = (complete%20eq%20false)


Appery.io and Azure Mobile Services - Cant filter in URI

Posted: Fri May 30, 2014 3:27 pm
by Dave Shepherd

Hi Katya.

Brilliant!!! Brilliant!!! Brilliant!!!

Was close to giving up on it.

So to sum it up for my example:

URL = "http://mysite.azure-mobile.net/tables..."
Create a request parameter called $filter
Pass in a value of (assignedto eq 'Dave')

Now its just a case of passing the value(replacing 'Dave') in from a local variable.

Thanks for your help

Regards
Dave


Appery.io and Azure Mobile Services - Cant filter in URI

Posted: Sat May 31, 2014 8:03 pm
by pakbull6772540

Some further clarity maybe needed.

define a request parameter as $filter

in the test tab, add a statement in front of $filter as

(ideq"12344")

where "12344" is the unique identifier of a row in the collection. or add a space using %20 around eq as:
(id%20eq%20"12344")

do we need the parentheses. Does appery adds the = so that the final statement looks like:

?$filter=(id="12344")

http://msdn.microsoft.com/en-us/libra...
http://docs.oasis-open.org/odata/odat...


Appery.io and Azure Mobile Services - Cant filter in URI

Posted: Sat May 31, 2014 8:30 pm
by pakbull6772540

I was able to run the test successfully. Here is the statement I had in the $filter request parameter:

(risklevel eq '6')

please note the %20 for the space will error in the test. also the strings must be in single quotes directly and not using the % code for them.
Here is a link for additional info:

http://msdn.microsoft.com/en-us/libra...


Appery.io and Azure Mobile Services - Cant filter in URI

Posted: Sat May 31, 2014 8:50 pm
by pakbull6772540

Here is a bit more example. (Do not use the %20 while building the filter in javascript as well)

var usrID = localStorage.getItem('ls_userID');
var locID = value;
locID = locID.trim();

var whr = "location_scenario_id eq '" + locID + "' and observer_id eq '" + usrID + "'";
//alert(whr);
return whr;

//see for reference: http://msdn.microsoft.com/en-us/libra...
//for azure https://myaccount.table.core.windows....'


Appery.io and Azure Mobile Services - Cant filter in URI

Posted: Mon Jun 02, 2014 7:59 am
by Evgene Karachevtsev

Hello,

Thank you for the update. Do not hesitate to contact us if you need any further help.