I’m using the wix built in member’s area, however on the my-account page I hid the default forms and created my own. Upon registration, I have all the user’s information go into a custom dataset which I want to then be displayed in the information fields on their my-account page (I have connected each text field to the dataset and set it to read only). I also have an update profile page set to read and write where they can update the information on their account page.
I had it working before when I was dealing with other issues (previously I wasn’t using the wix member’s area) but now that I am, I’m not sure how to connect my custom dataset to the privatemembers dataset that wix automatically creates with the members area because the my-account page is created to display information of the user ID from the private members dataset…but all my user’s information is in my custom dataset.
I haven’t done any code for this because I don’t even know where to begin
I have both the members profile as like this here.
https://support.wix.com/en/article/corvid-tutorial-building-your-own-members-area
Plus the My Account page as shown here.
https://support.wix.com/en/article/about-members-area
Anyways, here is the info for the Members PrivateMembersData collection.
https://support.wix.com/en/article/corvid-wix-members-privatemembersdata-collection-fields
Needs to be called as Members/PrivateMembersData, for example like this.
export function getUserDataByEmail(email) {
return wixData.query("Members/PrivateMembersData")
.eq("loginEmail", email)
.find();
}
I don’t really understand your instructions. I tried doing a custom members profile from the first link you mentioned in the beginning but I had a lot of issues trying to redirect to that page as a member.
Can you explain what that piece of code would be doing? I’m really new to coding.
Basically I am using the built in wix members area
- Users register on custom registration form which populates a dataset I created called “members” because there are a of fields that are required upon registration.
- Upon membership approval, users login and get redirected to wix’s default my-account page (I have customized this page to have fields reflecting the ones they filled in upon registration
- I want the information from my custom “members” dataset to be shown on their my-account page and the reason it’s not working is because I don’t know how to connect my custom dataset and the default privatemembers dataset where the userid is autogenerated.
You tried doing the custom profile, great as it is an easy tutorial to follow and it shouldn’t be put in your Wix Members app pages. Leave it as it’s own dynamic pages as in the tutorial.
As for connecting the user to the profile, that is simple too, just use the code in the tutorial.
export function profileButton_click(event) {
wixLocation.to(`/Members/${wixUsers.currentUser.id}`);
}
Just remember that the page is unique for each member and can only be viewed by that member themselves. When you view in preview you are setup as admin, however it needs to be tested on a fully published website for it to be shown working properly.
Note:
The functionality for logging users in and out of your site only works fully when viewing your published site. You will not be able to fully test your member profile pages in preview mode.
Therefore, when you have logged into the website to test it, you will be only able to view your own member profile and nobody else’s which is what it us supposed to be setup to do.
As for the Wix Members app My Account page, I use that as it already shows the login email that the user has used - which can’t be changed - and also allows them yo update their email address for notification purposes and changes it in the users collection too.
Otherwise, if you just used the members dataset from the profile tutorial, then you would have to have some sort of event or an automation setup to tell you that the user had changed their email address for notifications etc and you would have to change their email details yourself in your site member group in your Wix Contacts.
If you want members to be taken to their My Account page after they have signed up, then simply change the location to this.
export function myaccountbutton_onclick(event) {
wixLocation.to(`/account/my-account`);
}
You can already see all the code that I have used myself on my previous replies to you here.
https://www.wix.com/corvid/forum/community-discussion/member-login-leading-to-error-page
Sorry I’m still not sure you understand what I’m trying to accomplish. My registration form works fine already, it connects to my custom members dataset fine, I get redirected to the “my account” page within the wix member’s area just fine upon login (I am no longer using the custom member’s profile page, I am using wix’s default “my account” page in the wix member’s area)
I have customized the “my account” page to have all of the fields that are in my registration form with the intent that the information that they registered with should automatically show up there as a read only page. (Basically I hid the default “my-account” form and picture etc. and shoved them off to the side of my screen).
My issue is that even though those fields are each connected to my custom members dataset, it still does not show that information when I test and I assume it’s because the default “my-account” page shows information based on the user ID field in the default “Private Members” dataset that gets created when you add a wix member’s area to you site rather than the ID field from the custom dataset I created.
When I attempted to create a custom profile page previously using the tutorials you mentioned, I continued to get 404 errors when trying to redirect to that custom profile page with the ID field which is why I switched the wix member’s area instead which has worked all up to this point.
@megansauer
Just use the owner id field of the members dataset then as that is the same as the id in the privatemembersdata collection.