Stefan Zier
Posts: 0
Joined: Sun Jun 01, 2014 7:22 pm

How can I have a user upload their own "Bio" and have that stored in the database?

Here is the link below

App Link

Thank you again for all the help!
Here is how I want the whole app to work so far:

1) Go ahead and create an account (ignore the "client" and "provider" checkboxes, I haven't figured out how to assign a user a role yet...)

2) SignIn

3) Be able to change your picture (need it to save to DB)

4) Be able to upload a bio (need it to save to DB)

This is what I want the app to do so far. I have already provided pictures above as to where I am stuck so I hope that helps. Let me know if you need anything else from me.

I sincerely appreciate everything you have done. Thank you!

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How can I have a user upload their own "Bio" and have that stored in the database?

Hi Stefan.

At first in your sign up page you need to make next modifications(assign your sustem user to User_info row):

1 add to your "Users" system collection new field with name "userInfoId" type string. http://prntscr.com/3q12g8/direct

2 On signUp click - you need to create item in "User_info" collection with empty or default values. This create service return "_id" store this id in "currentUserInfoId" LSV.

3 Open your signUp service. Navigate to request tab and add "userInfoId" parameter. http://prntscr.com/3q0tvi/direct

4 Open signUp datasource and click "Edit mapping". Add new mapping from LSV "currentUserInfoId" to "userInfoId" request parameter. http://prntscr.com/3q0w44/direct

5 Then on success even on create service invoke signUP service.

So after these steps you will get new empty ROW in your "User_info" collection and new row in system User collection with correct filled "userInfoId" field.

Please don't go ahead until you get this work.

After you have these new two rows in your DB you need to do following steps(to update photo):

1 Open your "Account" page.

2 Navigate to "Data" page.

3 Find datasource for "User_Info_update_service" and click "Edit Mapping".

4 Open "Request" tab and find "bio" request parameter. Make mapping from "bioentry" label component to this "bio" request parameter.

5 Find "_id" parameter. Click on "Add JS" button and populate it with following code:

precode

return localStorage.getItem("currentUserInfoId");

/code/pre

6 On "Update" button click delete current event handler and add event handler with following code:

precode

var bioentry = prompt("Please update your bio...");

Apperyio("bioentry").text(bioentry);

restservice4.execute();

/code/pre

After these steps you will update your "bio" column in current user row. Please check it out in your DB.

Regards.

Stefan Zier
Posts: 0
Joined: Sun Jun 01, 2014 7:22 pm

How can I have a user upload their own "Bio" and have that stored in the database?

Thank you so much! I followed your steps wonderfully until:

"5 Then on success even on create service invoke signUP service. "

I am confused on what you meant here and you said not to move on till this and the previous steps are completed

Stefan Zier
Posts: 0
Joined: Sun Jun 01, 2014 7:22 pm

How can I have a user upload their own "Bio" and have that stored in the database?

UPDATE: on signUp view when the user clicks "Done" the signUp these services are invoked and the userInfoId is reflected in the database.

I thought just to test I should move forward with your instructions and so far I can only get the bio entry to display, not save in the DB.

Stefan Zier
Posts: 0
Joined: Sun Jun 01, 2014 7:22 pm

How can I have a user upload their own "Bio" and have that stored in the database?

Here is a screenshot of my iPod with the status bar still there.
Image

Stefan Zier
Posts: 0
Joined: Sun Jun 01, 2014 7:22 pm

How can I have a user upload their own "Bio" and have that stored in the database?

Hi Yurri. I have been reviewing your instructions and am still unable to see the bio stored in the DB. Here are screenshots I have taken and I have shared my app with Appery Support.

User_Info collection
Image

"bio" column in Users collection
Image

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

How can I have a user upload their own "Bio" and have that stored in the database?

Hi Stefan,

Please see the detail instruction again, section 2. On click invoke create_service for User_info with default values, and save a returned id in a local storage variable "currentUserInfoId". Invoke signUp_service on create_service Success event and follow the tutorial.

Stefan Zier
Posts: 0
Joined: Sun Jun 01, 2014 7:22 pm

How can I have a user upload their own "Bio" and have that stored in the database?

Hi Katya. Thank you for your input. I believe I am really stuck here because I do not see a new ROW in my User_Info collection

"2 On signUp click - you need to create item in "User_info" collection with empty or default values. This create service return "_id" store this id in "currentUserInfoId" LSV. "

How exactly do I create an item in User_info collection with empty or default value?

Thank you and sorry for the late reply, I did not have access to my computer.

Here are screenshots of my database
Image
Image

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

How can I have a user upload their own "Bio" and have that stored in the database?

Hello Stefan,

You should call create_service for your collection User_info. For this import rhis service in your project:
http://devcenter.appery.io/documentat...
Parameters photo and bio you may keep empty

Stefan Zier
Posts: 0
Joined: Sun Jun 01, 2014 7:22 pm

How can I have a user upload their own "Bio" and have that stored in the database?

Hi Evgene thank you for the response. Would you mind showing me what you mean in a screenshot? I'm not sure if I completely understand.

Thank you!

Return to “Issues”