Member vs. Contact - Collections

I am confused by how members are being saved using Velo Tutorial: Building Your Own Members Area | Help Center | Wix.com.

Is there anything special about the name “Member” - is that a keyword or can the table in these docs be named anything else? If the “Member” collection was named “Foobar” would this work?

Also, i am confused how the code is working to allow the member in the Member collection to access a page that has been marked as “members-only”. If you follow the method described in these docs, when the user uses the Login form and is a new member, are they being saved in the accessible-by-me collection called Member or are they being saved in the not-accessible-by-me collection Contact, or are they being saved in both somehow? They seem to be able to access ‘members-only’ pages after logging in using this flow. How does the members-only page know the currentUser is a Member - is it checking the Member collection or the Contact collection?

3 Likes

I have the same question. I just loaded 1404 “members” into MY Members database. After spot verifying all the records. I exported the sandbox database to live. Then I tried to login using one of the entries in my Members database. For my initial testing of this Member-Profile/Login Update, I had to click the "Not a Member, SignUP link on the Wix Login Form. Once I did that I could login and update my Profile. The Wix Login form seems to have NO KNOWLEDGE of my Members? I guess it uses the Contacts database? How do we sync the two?

2 Likes

Hi,

I get the confusion.
cwvega is right…
There is no automatic connection between your site members and your dynamic page profile.
The connection is what you are setting for them.
This article allows you, as a site owner, to build a page for each of your members, using code, but does not create it automatically.
Moreover, if you’ll add a record to the database, it will create a page even if you don’t have a corresponding member.

So, having said that… there’s no technical meaning for the Naming… it’s just a good practice to have meaningful naming.

Liran.

1 Like

They seem to be able to access ‘members-only’ pages after logging in using this flow. How does the members-only page know the currentUser is a Member - is it checking the Member collection or the Contact collection? Any details on how this works would be helpful.

Thanks Liran,

So, I take it that the Contacts database cannot be extended to include the fields in my database thus allowing me to use it instead of a custom database? What I am really waiting on is an official Paid Membership feature. In building my proof of concept, I created a user input form to “join” but dont have the hooks to accept payment. After adding myself to my Membership database I still had to SignUp in order to login. If I understand correctly, I will have to Export my custom database and Import into the Contacts. Then maybe set Contacts so that an administrator approves first who will then need to rekey the membership info into our custom Membership database. A very cludgy way of doing things.

2 Likes

Or maybe use Wix Code to create the Contact database entry within my “join” user input form?

I think it will be more precise to say that you can extend only collections that you have created and updated.
In the term of Wix Code, you do not have a collection of Member. Only a collection that reflect the member list (the data is both in the site members data and your collection).
Therefore, if you force every user to submit a form, you can just add their email to the submitted data.

1 Like

Thanks Liran. I already have the email address AND password in my collection this is captured during the “join” user input. Those fields are also in the CSV file that I imported into my Membership database. I just looked at my site’s Contacts and ONLY see the 3 or 4 test records there? What am I missing here?

1 Like

Hi Liran,

I am still confused by this too. It is very unclear when you say this:

“In the term of Wix Code, you do not have a collection of Member. Only a collection that reflect the member list (the data is both in the site members data and your collection).”

Can you provide some clear documentation?

When you say “site members data” what do you mean? Do you mean the Contacts collection which we do not have access to? Or something else?

How does Wix Code determine if a user should be able to access a page marked as ‘members-only’ - is it from the Contacts collection-which-we-dont-have-access-to or some other means?

If you follow the guide listed and use a Members table, then how can a logged in Member gain access to a page marked members-only? How exactly is this working? Any chance of adding clear documentation?

Adam

4 Likes

Ok… I know it’s confusing so I’ll try to put some sense into it by breaking it into three subject:

  1. Wix Members
  2. Wix Code
  3. Collections and site database

Every Wix site can you the Site Members functionality (regardless of Wix Code).
This means, that when you add a Login/Signup button to your site, users can register, and somewhere in the Wix server there’s a database that hold that information.

Now,
The basics of Wix Code is having APIs to communicate with Wix features.
So, looking at the Wix Users feature, you now have the API listed in wixUsers , which does not contain a function as ‘getAllUsers()’, but do contain ‘getCurrentUser()’, which returns information about the user that is currently logged in to your site (of course, per computer).

The third part is Database collection.
Just as ‘Wix Members’, databases have an API for code described mostly by wixData (but is also accessible using dataset).
This allows you to create and manage your own data.

So, let’s say we want to save some data regarding our users in the site (for example, their age).
The flow will be as follows:
User gets to signup page (using a button that we added) → a User entry is created in Wix Members (automatically, nothing we need to do) → We ask the user for his age (using a page we created with some sort of input) → we save the info to database (using wixUsers.getCurrentUser() and wixData.insert()).

So what we get actually, is a way for us to save extra info about a signed in users, in terms of database that saves submissions.
But, if an existing user does not submit data, then he won’t appear in our database, and, we can add rows to that database, but this doesn’t mean that a user is created for the site.
For example, I can do to my database and add a row:
USER AGE
liran@someemail.com 32

But still, if the user ‘liran@someemail.com’ hasn’t registered to the site, he will have to go through the signup process when he arrives.

Hope this makes it a bit clearer.

Liran.

1 Like

Thanks Liran. So this confirms that in order for this to work for me I have to Export my CVOA-Members and then Import them into the Contacts database. This should allow any of these users to now login. However, going forward, since there is no AddUser or InsertUser in WixContacts API it will have to be a manual process for the Admin to get the user info into the Contacts dataset.

Also, please clarify. Do I need to import All this same data my MY collection or just the ID, email and password into Contacts?


In the code above from https://support.wix.com/en/article/how-to-create-member-profile-pages-with-wix-cod e, the login function returns a user object.
Can you tell me about that user object?
On what collection does that user exist?
What attributes are available to us besides user.id?
Is it that when someone logs in, that Wix creates a new user on some Wix collection and that we can then have access to the attributes of that user and save the user on one of our own collections? Is that correct?

I am confused what you mean by “logged in” - what is required for a visitor to login? Do they have to exists in a Wix collection like the Contacts collection OR can they login in if the record exist only in a collection of my own making like Members?

1 Like

Since no one from Wix development is responding, I thought I would see if importing ID, Email, and Password into the Contacts. Unfortunately, the mapping process between the CSV file ONLY would allow me to map the email. No reference to ID or Password. I see this as a SHOW STOPPER to further development of my site until the official Paid Membership is release WITH the ability to extend the Contacts database or possibly even allow the use of a Custom Members database for login INSTEAD of Contacts.

3 Likes

Sorry for the delay in response.

Adam, you can see the User object here .
cwvega,
I can’t say what data you need to copy there since I don’t know what you’re using the data for.
BUT,
I must say that having the users passwords in your database is not the best thing to do (security).
Have a look here at a post that I have answered to, regarding managing your own users system.

Liran.

Thanks Liran. I really dont’t need to store the password I was just seeing if I could, as you alluded to in a previous response, populate the Contacts database with the same info in my custom database. I think I read in Wix Login/Contacts API where I could send a user a password reset request.

To clarify my use, my site is a collector car club. My custom database contains quite a few fields NOT included in the contacts database, one of which is a member_id. I will be creating another database that contains information about the car that the member owns. This info is coming from a relational database, so at a dynamic page creation for displaying the car info and photos, the member’s name comes from the member database via the member id. I believe you guys are calling this a “trigger”?

What I am trying to accomplish, is allowing an existing member to login and then have access to the member protected pages. I tried extending the Contacts database by adding the _id and email field, which it accepted, but then when I went to Import my data, the new fields I added were not shown on the mapping menu. Do I really need the ID in the Contacts database? Is it JUST for member validation and keys off the EMAIL ADDRESS? and internal password?

Login Flow:
I have created a user input Form for the initial creation of my custom member database entry. I then implemented the Member Profile feature to allow a user to login and update their profile. But the user cannot login to update his profile (even tho his info was just created in the custom database). He will have to click on the “Not a member, Sign Up” on the Wix Login Page! This is what I am currently fighting with. If I populate the Contacts by loading a CSV file of fname, lname, and email, can I then click on Forgotten Password on the Wix Login form to get around this?

Thanks So Much For You Insights!
JD

Hi JD,
You got me confused…
If you’re trying to load a csv file with contacts (are they members?), then you load it in to your own database, and you are not loading it to the real Wix Users data (See first paragraph of my explanation).
You cannot load a Site Members csv (as you cannot add one without the users signing up as a Wix User).

Simply stated. I loaded my members CSV as extracted from my IBM Informix relational database, into my wix custom Membership Database but they cannot login. So this proves to me that the Login mechanism for my site does not use, nor have any knowledge of, My membership database. This is the basis of this thread started by Adam when he wrote:

"… when the user uses the Login form and is a new member, are they being saved in the accessible-by-me collection called Member or are they being saved in the not-accessible-by-me collection Contact, or are they being saved in both somehow? They seem to be able to access ‘members-only’ pages after logging in using this flow. How does the members-only page know the currentUser is a Member - is it checking the Member collection or the Contact collection? "

My last test seems to confirm that the “source of truth” for member validation and protection of pages is the Contacts database.

My question was, can I just load the email address of my membership database into the Contacts so my users can login? Of course they will have to do the Forgot password and have a password set first.

1 Like

Sorry interrupting here …Let me see if I can’t take a stab at it …

Adam/cwvega76,

The wix member login prompt pop up … opens up Wix Member app. wix member app adds people to your wix contacts in your site dashboard area. Wix members app works with page settings. You select what pages are public and which are for members only. Right now, since there are no levels of member permissions … any page that is set to members only will be accessible by ANY member.

Now the database you create: whether its called Members , mambos, Mothers. lol

It does not “talk” to your wix contacts app inside of your dashboard. The reason you create this database is so that you can tell your database that THAt specific person that is logged in will land and view that specific page.

The “talking” you are looking for is coming soon. You will be able to set roles and permissions to access different pages. You will also be able to “talk” between the contacts app and your custom created database.

Check it out here: www.wix.com/code/home/coming-soon

5 Likes

Thanks Nayeli, So if I load the email addresses that match MY custom Members database into the Contacts my existing “members” should then be able to login (after a request for password reset).

1 Like

Unfortunately no. At least not yet until they release the API.

When a member signs up, they are added to your contacts and ‘tagged’ as a member.

You cannot tag contacts as a member you manually input.

I understand what you are trying to do … trying to prevent existing members from having to go through the whole sign up process again.

I need a solution for this also, as I too am working on a site that needs something similar. I am waiting for those features listed in the coming soon announcement …

4 Likes