Chris Flowers6766842
Posts: 0
Joined: Thu Mar 27, 2014 8:26 pm

Database columns not populating with information entered

Hello!

My question is two part:

1)

I have added a login/signup page to my app by following this guide:

http://devcenter.appery.io/tutorials/...

Using the predefined collection 'Users', I have it working for login and signup. The database is populated with 'username' and 'password' when a user signs up. However, I added three more columns to the database:

  • Name

  • Company

  • Email

    As shown here:

    Image

    I created input components on my sign in page:

  • Name

  • Company

  • Email

    I then mapped those as I did for username and password, as shown here:

    Image

    When I test it, and return to the database, I can see a new row (new user) is added but only the username and password fields have data. The three I added are blank (despite me adding the information to the input boxes during test).

    What am I doing wrong!?

    2)

    Once I sort out problem 1) I then need to work out how I auto fill input components on another page with that information from the database, as shown here:

    Image

    So the name input would pull the information from the name field in the database, the company input would pull the information from the company field in the database and same for email address.

    I think I need to use the READ service but I'm not sure how I achieve that. When I CREATE NEW DATABASE SERVICE DATABASE SELECT I can't see READ in the collection services, only when I expand _FILES.

    Any help greatly appreciated!

    Thanks!

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Database columns not populating with information entered

Hello Chris,

Make sure that the names of the fields in the database are the same, for example register is important: User and user are different names .
To receive information about the specific user you should create a REST service like this: http://devcenter.appery.io/documentat...
or there:
http://devcenter.appery.io/documentat...

Chris Flowers6766842
Posts: 0
Joined: Thu Mar 27, 2014 8:26 pm

Database columns not populating with information entered

Hi Evgene

Thank you for that. Something so simple in the end! The database columns are populating correctly now.

I'm still a little bit confused with part two of my problem. The links you provided seem to be queries for specific user.

Basically, for the user who has just signed in or just registered, I want their 'Name', 'Company' and 'Email' information pulled from the database entries used to complete same named input components on another page.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Database columns not populating with information entered

Chris,

When user regiser or login in reply one of the parameters is "id". Keep it in local storage as value: http://devcenter.appery.io/documentat...
After that you can get user by this id on the next page: http://devcenter.appery.io/documentat...
You should pass id value in URL this way:
http://devcenter.appery.io/documentat...

Chris Flowers6766842
Posts: 0
Joined: Thu Mar 27, 2014 8:26 pm

Database columns not populating with information entered

Hi Evgene

Sorry, I'm still struggling with what I need to do exactly.

On my signin page I've set local storage variables for input components 'Name', 'Company' and 'Email'.

What I don't know how to do is call on those local storage variables to fill the same input components on another page.

X, Y, Z entered here:

Image

Fills X, Y, Z here:

Image

On the second screenshot I need to have those input components auto filled OR be changed by the user.

Chris Flowers6766842
Posts: 0
Joined: Thu Mar 27, 2014 8:26 pm

Database columns not populating with information entered

Hang on, this won't always work?

This is fine if the user has JUST registered, as they will have entered information in those inputs, however some users will already be registered and won't enter information in those three components.

For both instances, I need to get the data from the database for the current user and populate X, Y, Z on the last page.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Database columns not populating with information entered

Please read this tutorial:
http://devcenter.appery.io/tutorials/...
It will make many aspects more clear.

Chris Flowers6766842
Posts: 0
Joined: Thu Mar 27, 2014 8:26 pm

Database columns not populating with information entered

Ok I went through it again and I'm nearly there.

I created a new collection in my database titled 'Details'. I made three columns 'name', 'company' and 'email'. In my app I added a database service and chose from 'Details' collection the 'list' service. On it's response mapping page I mapped the items to the text field for the relevant component. I set an on load page event to invoke the service.

I tested the app. I registered. The database populated correctly and it worked, however it did not populate the text fields with THAT users details, it used another users details.

Chris Flowers6766842
Posts: 0
Joined: Thu Mar 27, 2014 8:26 pm

Database columns not populating with information entered

Nevermind! Sorted it! Had to map the userSessionToken

Chris Flowers6766842
Posts: 0
Joined: Thu Mar 27, 2014 8:26 pm

Database columns not populating with information entered

Thought I had solved it but I don't. It still populates the text fields with the first user in my database's details, not the details of the user who has registered or signed in :(

This is what I have done:

Image

Image

Return to “Issues”