Page 1 of 2

column name from Users data collection does not appear for mapping

Posted: Thu Feb 13, 2014 2:57 am
by Sean Comar

I am following the tutorial, http://docs.appery.io/tutorials/build...
I created two additional columns, email and secret_code in Users data collection of a database which I was already using (I did not create a new database).
Imported all the database services, and added sign-up service to Register screen. When I click on Edit Mapping, the email parameter under Request tab is missing. I have imported the sign-up service a couple of times, but I just can't see the email field though I can verify it exists in Users data collection.
What can be the reason? I have made my, DBSYS app public and shared it with support so that you could take a look. Thanks


column name from Users data collection does not appear for mapping

Posted: Thu Feb 13, 2014 3:38 am
by Igor

Please try to add this field manually or using "Automatically create from Sample response". http://docs.appery.io/documentation/r...


column name from Users data collection does not appear for mapping

Posted: Thu Feb 13, 2014 4:04 am
by Sean Comar

Thanks for the clarification because it was not mentioned in the tutorial so I assumed additional fields from the Users data collection are included in sign-up service.


column name from Users data collection does not appear for mapping

Posted: Thu Mar 13, 2014 6:00 pm
by Malcolm van Raalte

I'm having a similar issue. I've added a firstName column to the Users collection. I have manually added the field to the login service response, but it is not coming through when I test the service. Anything else needed?


column name from Users data collection does not appear for mapping

Posted: Thu Mar 13, 2014 8:09 pm
by Nikita

Hi,

You should create rest service:
http://docs.appery.io/documentation/r...

for users collection reading:
http://docs.appery.io/documentation/b...
(you should implement get service)


column name from Users data collection does not appear for mapping

Posted: Thu Mar 13, 2014 9:20 pm
by Malcolm van Raalte

Done, and working.


column name from Users data collection does not appear for mapping

Posted: Thu Mar 13, 2014 9:53 pm
by Malcolm van Raalte

Well, not quite. The URL that is required is

https://api.appery.io/rest/1/db/users/

When I create a REST service I have the option to add parameters - but they become querystring parameters. E.g.:
https://api.appery.io/rest/1/db/users...=

How can I configured my service so that the userid parameter gets placed at the end of the path of the URL?


column name from Users data collection does not appear for mapping

Posted: Fri Mar 14, 2014 1:30 am
by Alena Prykhodko

Hi Malcomlm.

To add parameters directly to the url you can use code{some_id}/code. Please take a look here: http://docs.appery.io/documentation/r... section "Parameters in URL"


column name from Users data collection does not appear for mapping

Posted: Sun Mar 16, 2014 7:47 pm
by Jamie5245261

Hi gang,

I've read the documentation that Alena pointed to, above, and I'm confused. I think it may be by the syntax used in the documentation's example.

Say I have a global variable in my javascript that contains a URL that changes from time to time, how do I get that URL into the {some_id} that is discussed in the documentation?

As suggested, I've tried "passing it in as a parameter":

emsomeRESTservice.execute(DynamicURLglobalVariable);/em

...and then I litterally put {DynamicURLglobalVariable} in the REST service's URL field and I'm clearly way off the mark.

Could you clarify, with an example, please?


column name from Users data collection does not appear for mapping

Posted: Mon Mar 17, 2014 1:26 am
by Alena Prykhodko

Hi Jamie.

In http://host/name/edit/{some_id}

"some_id" would be set when the service is invoked. In this case, "some_id" should be defined as a request parameter. Any part of the URL can be expanded this way, even the entire URL.

So it means that you just need to have request parameter called "some_id".
As to your code you should invoke the service with the following code:
pre
someRESTservice.execute({data: {some_id: "some_your_value"} });/pre

After this code your "some_your_value" value will pass in the url and result url would: pre"http://host/name/edit/some_your_value"/pre

Besides you have other one way to pass this parameter (through the mapping).

  1. On Request tab add parameter and "some_id".
  2. Fill it as you need with mapping and "Add JS".
  3. Value will be automaticaly passed into url.