Page 2 of 3

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

Posted: Wed Jun 04, 2014 11:24 pm
by Stefan Zier

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!


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

Posted: Thu Jun 05, 2014 10:27 pm
by Yurii Orishchuk

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.


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

Posted: Fri Jun 06, 2014 4:11 am
by Stefan Zier

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


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

Posted: Fri Jun 06, 2014 5:12 am
by Stefan Zier

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.


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

Posted: Sat Jun 07, 2014 5:35 am
by Stefan Zier

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


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

Posted: Sun Jun 08, 2014 4:21 pm
by Stefan Zier

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


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

Posted: Mon Jun 09, 2014 8:18 am
by Kateryna Grynko

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.


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

Posted: Thu Jun 12, 2014 12:43 am
by Stefan Zier

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


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

Posted: Fri Jun 13, 2014 5:14 pm
by Evgene Karachevtsev

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


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

Posted: Mon Jun 16, 2014 4:48 pm
by Stefan Zier

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!