Page 1 of 1

Server Code Service - Request Query String

Posted: Wed Aug 02, 2017 10:05 am
by Paul Medawar

hi,

I'm running some server code to group and sum data.

Then in the app I'm running a server code service, which gives the following response

[{
"totalSum": 8,
"Gamer": "JOHN",
"Location": "A"
}, {
"totalSum": 20,
"Gamer": "ALAN",
"Location": "A"
}, {
"totalSum": 21,
"Gamer": "FRANK",
"Location": "B"
}]

I'm trying to use "where" as a request query string as follows

{"Location":"B"}

but it has no effect on the response.

This method works fine for normal database services, is their an issue with running it for server code services?


Server Code Service - Request Query String

Posted: Wed Aug 02, 2017 12:07 pm
by Bruce Stuart

Hi Paul,

You would need to pass the where clause as a parameter to your server code, in your server code add the same parameter , and then in the server Code ... read the parameter in the server Code and use it in the queries in the server code queries to extract the data.

Make sense ?

Best,
Bruce
a href="mailto:Bruce.stuart@the-software-studio.com" rel="nofollow"Bruce.stuart@the-software-studio.com/a


Server Code Service - Request Query String

Posted: Fri Aug 04, 2017 2:44 pm
by Paul Medawar

Hi Bruce,

thanks for getting back to me. Is their no way of running a query on a server code service response?

Best

Paul


Server Code Service - Request Query String

Posted: Fri Aug 04, 2017 3:46 pm
by Bruce Stuart

Hi Paul and Happy Friday,

You can certainly take the server side results that come back - and 'filter' them prior to presenting them on your UI (if that's the goal - and I presume it is....) - and you can perform multiple steps after data retrieval and prior to presenting the data on the UI.

Attached below - please find an example below where we do multiple steps after the data comes back prior to - in the last step - where we present the data :

Image

This goal could also be accomplished with a generic service - we just find using the Javascript to be much more efficient -and quick.

Let me know if that makes sense....

Bruce Stuart
a href="mailto:Bruce.Stuart@the-Software-Studio.com" rel="nofollow"Bruce.Stuart@the-Software-Studio.com/a
(253) 678-3348

Image


Server Code Service - Request Query String

Posted: Mon Aug 07, 2017 6:12 am
by Paul Medawar

Hey Bruce,

thanks a lot mate, using local storage to accomplish what I need.

best

paul