# New Article: How to Create Member Profile Pages

**URL:** <https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548>\
**Category:** Show and tell\
**Tags:** tips, code\
**Created:** [September 26, 2017, 8:20am UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548 "2017-09-26T08:20:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sam-wix/32/683_2.png) [@sam-wix](https://forum.wixstudio.com/u/sam-wix)\
**Post date:** [September 26, 2017, 8:20am UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/1 "2017-09-26T08:20:12Z")

</div>

We just added a new article demonstrating how to create a member profile page for each of the registered users of your site.

> **[Building Your Own Members Area](https://support.wix.com/en/article/how-to-create-member-profile-pages)**
>
> In this article we demonstrate how to create a profile page for each of your site members. The data for the dynamic profile page is created when a site visitor first logs in to your site. Members can view and update their personal profiles at any...

We’d appreciate any feedback on whether or not you find the article helpful.

---

<div class="post-metadata">

**Author:** ![impressiveimpact](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/impressiveimpact/32/901_2.png) [@impressiveimpact](https://forum.wixstudio.com/u/impressiveimpact)\
**Post date:** [September 27, 2017, 4:31pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/2 "2017-09-27T16:31:38Z")

</div>

OMG, I have needed this for years. Can’t wait to get a minute to read and experiment. Thank you.

---

<div class="post-metadata">

**Author:** ![walkingbillboards-al](https://avatars.discourse-cdn.com/v4/letter/w/dbc845/32.png) [@walkingbillboards-al](https://forum.wixstudio.com/u/walkingbillboards-al)\
**Post date:** [September 28, 2017, 4:21pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/3 "2017-09-28T16:21:30Z")

</div>

I followed this step by step and initial tests indicate it is working great!! I will let you know if I encounter any bugs when I test it further! Thank you for a VERY easy to follow guide!!

---

<div class="post-metadata">

**Author:** ![david-seroy](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/david-seroy/32/868_2.png) [@david-seroy](https://forum.wixstudio.com/u/david-seroy)\
**Post date:** [September 29, 2017, 2:51pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/4 "2017-09-29T14:51:01Z")

</div>

I have used this. Works very well, should be a popular article

---

<div class="post-metadata">

**Author:** ![ingcarlostello](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/ingcarlostello/32/949_2.png) [@ingcarlostello](https://forum.wixstudio.com/u/ingcarlostello)\
**Post date:** [October 13, 2017, 6:56pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/5 "2017-10-13T18:56:53Z")

</div>

I already put it into practice, but several things happen to me:

1. when it is going to make a register of new user stays loaded and says failure in the server.

2. sometimes does not let me register a new member, because it says it already exists. And it is not so, because that one member is not in the DB.

suggestions… ??

---

<div class="post-metadata">

**Author:** ![ingcarlostello](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/ingcarlostello/32/949_2.png) [@ingcarlostello](https://forum.wixstudio.com/u/ingcarlostello)\
**Post date:** [October 13, 2017, 7:29pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/6 "2017-10-13T19:29:40Z")

</div>

test the site and leave your comments and ideas  
here is the link to test the site:

[https://gadgetsutiles.wixsite.com/misitio](https://gadgetsutiles.wixsite.com/misitio)

---

<div class="post-metadata">

**Author:** ![marti-l](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/marti-l/32/953_2.png) [@marti-l](https://forum.wixstudio.com/u/marti-l)\
**Post date:** [October 27, 2017, 5:02pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/7 "2017-10-27T17:02:41Z")

</div>

I created a profilte ([test.test@email.com](mailto:test.test@email.com)) and it did create the account. I tried to update it and no fields were showing. Still in progress? #Feedback

---

<div class="post-metadata">

**Author:** ![ingcarlostello](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/ingcarlostello/32/949_2.png) [@ingcarlostello](https://forum.wixstudio.com/u/ingcarlostello)\
**Post date:** [October 27, 2017, 8:07pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/8 "2017-10-27T20:07:04Z")

</div>

Hi Marti

the fields to update are displayed when you click on the “Actualizar” button

try again please

---

<div class="post-metadata">

**Author:** ![ingcarlostello](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/ingcarlostello/32/949_2.png) [@ingcarlostello](https://forum.wixstudio.com/u/ingcarlostello)\
**Post date:** [October 27, 2017, 8:07pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/9 "2017-10-27T20:07:50Z")

</div>

Any suggestions to improve the interface and the operation I will gladly accept it.

---

<div class="post-metadata">

**Author:** ![david-seroy](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/david-seroy/32/868_2.png) [@david-seroy](https://forum.wixstudio.com/u/david-seroy)\
**Post date:** [November 2, 2017, 9:09pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/10 "2017-11-02T21:09:15Z")

</div>

I successfully used this tutorial. However, how can I get it so that it automatically forwards the user to the “update” page after creating a profile? Right now, it creates a profile, which is great!, but it then it’s just blank.

While we’re on the topic, is there any way to automatically pull certain information from their login? For example, if they log in through G-mail it will auto populate fields in our database??

---

<div class="post-metadata">

**Author:** ![arthosmaciel](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/arthosmaciel/32/912_2.png) [@arthosmaciel](https://forum.wixstudio.com/u/arthosmaciel)\
**Post date:** [November 6, 2017, 3:37pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/11 "2017-11-06T15:37:33Z")

</div>

I too would like to know the answer.

---

<div class="post-metadata">

**Author:** ![faidda7](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/faidda7/32/916_2.png) [@faidda7](https://forum.wixstudio.com/u/faidda7)\
**Post date:** [November 12, 2017, 1:22am UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/12 "2017-11-12T01:22:43Z")

</div>

Hi.  
I have a site that should require users to pay a subscription fee. So at first I just want to set some things:

1. I want to create a member profile page.
2. I want the login button to run a query that looks for a user ID in the collection I’ve created.
3. I want to redirect the users by their position: if the user exists in the payed members collection he needs to be redirected to a specific page. And if the users does not exists in the collection he needs to be redirected to the purchase page.  
when Im clicking the login button I created nothing happens and it says I have a problem in my code.  
the code Ive used:

* * *

```
import wixUsers from 'wix-users'; 
import wixData from 'wix-data'; 
import wixLocation from 'wix-location'; 
import wixWindow from 'wix-window'; 
export function profileButton_click(event) { 

```

[wixLocation.to](http://wixlocation.to/) (`/PaidMembers/${ [wixUsers.currentUser.id](http://wixusers.currentuser.id/) }`);  
}  
export function loginbutton\_click(event) {  
// user is logged in  
if (wixUsers.currentUser.loggedIn) {  
// log the user out  
wixUsers.logout()  
.then(() =\> {  
// update buttons accordingly  
$w(“#loginButton”).label = “Login”;  
$w(“#profileButton”).hide();  
});  
}  
// user is logged out  
else {  
let userId;  
let userEmail;  
// prompt the user to log in  
wixUsers.promptLogin({  
“mode”: “login”  
})  
.then((user) =\> {  
userId = [user.id](http://user.id/) ;  
return user.getEmail();  
})  
.then((email) =\> {  
// check if there is a match for the user in the collection  
userEmail = email;  
return wixData.query(“PaidMembers”)  
.eq(“\_id”, userId)  
.find();  
})  
.then((results) =\> {  
// if an item for the user is not found  
if (results.items.length === 0) {  
// redirect to pay for subscription  
[wixLocation.to](http://wixlocation.to/) (“/store”);  
}  
// if there is a match redirect to lessons page  
else {  
[wixLocation.to](http://wixlocation.to/) (“/arabiclessons”);  
} );

Thanks!

---

<div class="post-metadata">

**Author:** ![cwvega76](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@cwvega76](https://forum.wixstudio.com/u/cwvega76)\
**Post date:** [December 5, 2017, 12:50pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/13 "2017-12-05T12:50:39Z")

</div>

Sam,  
I have a custom membership database and have a membership application form with 19 inputs and a submit button connected to my custom membership the database. When I submit, the record goes into the live database as expected. This will be a paid membership and I know that is in the works but I wanted to experiment with the member profile update feature described in the above article.

I have implemented wix code as shown in the article to allow the member to edit his profile using a duplicated copy of the membefrship application form which has been changed to a dynamic page to retrieve info from the database.

I have double checked the code in the article and still cannot get it to work. After I login, The Login button changes to Logout and the My Profile button shows. But when I click on My Profile nothing happens? Can I please get a review of my site and tell me what I have missed?

Also, since passwords are not stored in my custom database, at the default Wix Login page I had to actually use the Set Up link to create the account? Is that normally the way this should work? That is just going to confuse my members as one just submitted the enrollment form which has NO Password Field? Should I add a Password field to the form and will that be used for the default wix login?

---

<div class="post-metadata">

**Author:** ![universinformatiquei](https://avatars.discourse-cdn.com/v4/letter/u/b2d939/32.png) [@universinformatiquei](https://forum.wixstudio.com/u/universinformatiquei)\
**Post date:** [December 5, 2017, 6:57pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/14 "2017-12-05T18:57:31Z")

</div>

For me it does not work… Here is my code in the page Login Client

import wixUsers from ‘wix-users’;  
import wixData from ‘wix-data’;  
import wixLocation from ‘wix-location’;

$w.onReady( () =\> {  
if(wixUsers.currentUser.loggedIn) {  
$w(“#loginButton”).label = “Logout”;  
$w(“#profileButton”).show();  
}  
else {  
$w(“#loginButton”).label = “Login”;  
$w(“#profileButton”).hide();  
}  
} );

export function loginButton\_click(event) {  
// user is logged in  
if(wixUsers.currentUser.loggedIn) {  
// log the user out  
wixUsers.logout()  
.then( () =\> {  
// update buttons accordingly  
$w(“#loginButton”).label = “Login”;  
$w(“#profileButton”).hide();  
} );  
}  
// user is logged out  
else {  
let userId;  
let userEmail;

```
// prompt the user to log in  
wixUsers.promptLogin( {"mode": "login"} ) 
  .then( (user) => { 
    userId = user.id; 
    return user.getEmail(); 
  } ) 
  .then( (email) => { 
    // check if there is an item for the user in the collection 
    userEmail = email; 
    return wixData.query("Customer") 
      .eq("_id", userId) 
      .find(); 
  } ) 
  .then( (results) => { 
    // if an item for the user is not found 
    if (results.items.length === 0) { 
      // create an item 
      const toInsert = { 
        "_id": userId, 
        "email": userEmail 
      }; 
      // add the item to the collection 
      wixData.insert("Customer", toInsert) 
        .catch( (err) => { 
          console.log(err); 
        } ); 
    } 
    // update buttons accordingly 
    $w("#loginButton").label = "Logout"; 
    $w("#profileButton").show(); 
  } ) 
  .catch( (err) => { 
    console.log(err); 
  } ); 

```

}  
}

export function profileButton\_click(event) {  
wixLocation.to(`/Customer/${wixUsers.currentUser.id}`);  
}

My database is called Customer  
WHERE IS MY MISTAKE ☹

---

<div class="post-metadata">

**Author:** ![cwvega76](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@cwvega76](https://forum.wixstudio.com/u/cwvega76)\
**Post date:** [December 6, 2017, 4:21pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/15 "2017-12-06T16:21:50Z")

</div>

I cannot get it to work either? Here is MY code:

import wixUsers from ‘wix-users’;  
import wixData from ‘wix-data’;  
import wixLocation from ‘wix-location’;

$w.onReady( () =\> {  
if(wixUsers.currentUser.loggedIn) {  
$w(“#button2”).label = “Logout”;  
$w(“#button3”).show();  
}  
else {  
$w(“#button2”).label = “Login”;  
$w(“#button3”).hide();  
}  
} );

export function button2\_onclick() {  
// user is logged in  
if(wixUsers.currentUser.loggedIn) {  
// log the user out  
wixUsers.logout()  
.then( () =\> {  
// update buttons accordingly  
$w(“#button2”).label = “Login”;  
$w(“#button3”).hide();  
} );  
}  
// user is logged out  
else {  
let userId;  
let userEmail;

```
// prompt the user to log in  
wixUsers.promptLogin( {"mode": "login"} ) 
  .then( (user) => { 
    userId = user.id; 
    return user.getEmail(); 
  } ) 
  .then( (email) => { 
    // check if there is an item for the user in the collection 
    userEmail = email; 
    return wixData.query("CVOA_Members") 
      .eq("_id", userId) 
      .find(); 
  } ) 
  .then( (results) => { 
    // if an item for the user is not found 
    if (results.items.length === 0) { 
      // create an item 
      const toInsert = { 
        "_id": userId, 
        "email": userEmail 
      }; 
      // add the item to the collection 
      wixData.insert("CVOA_Members", toInsert) 
        .catch( (err) => { 
          console.log(err); 
        } ); 
    } 
    // update buttons accordingly 
    $w("#button2").label = "Logout"; 
    $w("#button3").show(); 
  } ) 
  .catch( (err) => { 
    console.log(err); 
  } ); 

```

}  
}

export function button3\_onclick() {  
wixLocation.to(`/CVOA_Members /${wixUsers.currentUser.id}`);  
}

---

<div class="post-metadata">

**Author:** ![universinformatiquei](https://avatars.discourse-cdn.com/v4/letter/u/b2d939/32.png) [@universinformatiquei](https://forum.wixstudio.com/u/universinformatiquei)\
**Post date:** [December 6, 2017, 4:32pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/16 "2017-12-06T16:32:38Z")

</div>

It does not work for me to. See post [https://www.wix.com/code/home/forum/questions-answers/create-member-profile-failed](https://www.wix.com/code/home/forum/questions-answers/create-member-profile-failed)

Still no logical anwer for me ☹ I am sad today lol

---

<div class="post-metadata">

**Author:** ![cwvega76](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@cwvega76](https://forum.wixstudio.com/u/cwvega76)\
**Post date:** [December 6, 2017, 4:36pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/17 "2017-12-06T16:36:43Z")

</div>

Yeah, been fighting with this for a week! So much for VIP support. They will not help because its part of Wix-Code!

---

<div class="post-metadata">

**Author:** ![universinformatiquei](https://avatars.discourse-cdn.com/v4/letter/u/b2d939/32.png) [@universinformatiquei](https://forum.wixstudio.com/u/universinformatiquei)\
**Post date:** [December 6, 2017, 4:47pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/18 "2017-12-06T16:47:28Z")

</div>

The strange thing is that it appear that it is working for some people and some not. I know that the code of my website is good as a moderator of Wix succesffuly sign in as he told me. but for me, nada…

---

<div class="post-metadata">

**Author:** ![cwvega76](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@cwvega76](https://forum.wixstudio.com/u/cwvega76)\
**Post date:** [December 6, 2017, 5:35pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/19 "2017-12-06T17:35:20Z")

</div>

I can login with out a problem and the Login changes to Logout and it displays the My Profile, but clicking on My Profile does NOTHING for me??

Click on your Login button, then look at the Properties menu. Make sure you have the button2 enabled by default and the OnClick name matches your code

![](https://us1.discourse-cdn.com/wix/original/3X/0/5/05ca2ac96d73d3b073323979db4107f4e452546b.jpeg)

---

<div class="post-metadata">

**Author:** ![universinformatiquei](https://avatars.discourse-cdn.com/v4/letter/u/b2d939/32.png) [@universinformatiquei](https://forum.wixstudio.com/u/universinformatiquei)\
**Post date:** [December 6, 2017, 5:56pm UTC](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548/20 "2017-12-06T17:56:04Z")

</div>

Yes I’ve look and it’s all ok. ☹ Still does not work

[Next page](https://forum.wixstudio.com/t/new-article-how-to-create-member-profile-pages/28548.md?page=2)
