samwiltshire
Posts: 0
Joined: Sun Mar 18, 2012 1:39 pm

Using dynamic request parameters for server code requests

Thanks, it has been shared with the email above and the name is Ludus247.

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Using dynamic request parameters for server code requests

"filterService" doesn't return values because it requesting incorrect id.
Please try to add alert on service response and test once more.
pre
Image
/pre

samwiltshire
Posts: 0
Joined: Sun Mar 18, 2012 1:39 pm

Using dynamic request parameters for server code requests

Thanks for that - I have added the alerts, however, I am still at a loss on how I am supposed to use an ID that isn't the primary ID. For example, I am tying the users to the Teams collection by the 'user id' and 'username' columns in Teams however I can't seem to work out how I can then use the corresponding row in Teams without the unique _ID.

Hope this makes sense!

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Using dynamic request parameters for server code requests

Hello! Please clarify what data you store and where, what are you trying to get?

samwiltshire
Posts: 0
Joined: Sun Mar 18, 2012 1:39 pm

Using dynamic request parameters for server code requests

Ok, well I have a table called 'Teams' which has the columns:

  • teams

  • username

  • user id

  • _id etc

    I would like to query the database to get the data in 'teams' for the 'user id' or 'username' (I have both stored as a localStorage variable). Can you do this without the '_id'?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Using dynamic request parameters for server code requests

Hi,

Create request service with "where" parameter, map "user_id" to it and add the following JavaScript code for "where" parameter:
codereturn '{"user id": "' + value + '" }'/code
Please check the spelling of the field name: "user_id" or "user id".

samwiltshire
Posts: 0
Joined: Sun Mar 18, 2012 1:39 pm

Using dynamic request parameters for server code requests

Sorry, do you mean create a brand new service? Or to add a request parameter, 'where' on my existing, 'filterServerCode' service?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Using dynamic request parameters for server code requests

Add 'where' parameter to existing service.

Return to “Issues”