How to get member's username and use it in the database?

Hi !

So I’ve seen it was possible to create custom member’s page and all, the thing is I’m pretty much satisfied with Wix Forum members’ pages.
However I want members to be able to add content to collections (which is displayed in public on the website), this can be done with the basic “members only” feature, the thing is I want their nickname to be automatically added to the collection, so anyone on the website can see who posted what.

In addition to this, I want their username on repeater to be clickable, so anyone can access their profile.

Basically :

  • Automatically get the member’s nickname to put it in the data collection when they submit an article

  • Make their username clickable on the content they posted (public page)

To put it in simpler terms, any forum does that (even this very forum).

Can anyone provide me with the bits of code please ?

Thanks !

5 Likes

bump

Hi Tristan,
Did you see the documentation about current user? https://www.wix.com/code/reference/wix-users.html#currentUser

The thing is I don’t understand much about it.
Can you provide the bit of code that would get the username and insert it in a “username” field in a datacollection ?

Hi again,
As you figured out some coding skill are required in order to make it done.
You can hire an expert in Wix Arena

This shouldn’t be too complicated, I’m sure someone can provide the bit of code to achieve that.

Tristan,

there is no option at the moment to retrieve current user (site member) nickname to be used later in the site. only email and the id.
customising the site signup process it is a feature which is currently on Wix roadmap

Shlomi

2 Likes

Oh okay, I thought it was possible.

looking forward to it then

So it is currently not possible to save the UserID of the person who writes to my database? I would like like this.

Just add a button to the repeater where the etiquete is connected to their username and the link to their public profile. Just keep in mind each user has a public profile (everyone/members can read) and a personal profile to edit information and everything, only author can acess.

Wix Team, please add the userName function to the wix users API, it’s needed and makes sense if there is the user id and user email options. Thank you!

1 Like

Hi Bill,

The user id is saved in the db already, not the user nickname.
We are currently working on a Library called wix-crm, with lots if user related functionality, it should be released in the near future

Shlomi

1 Like

Thanks. I would like to save the user ID nickname in a field when then input data. Please tell use when available

1 Like

just interested on the progress

@warchugaming a while ago, we have released a set of libraries and APIs you can use to create your custom sign-up form.
please have a look here:

and here: https://www.wix.com/code/reference/wix-users-backend.html

good luck!
Shlomi

We need this function on wixUsers! If you give a heart to the suggestion below, Wix might notice it…
https://www.wix.com/corvid/forum/community-feature-request/get-any-data-from-wix-users

Ha. I just stumbled on this thread and am kind of surprised by the comments. I am relatively new to Wix coding, but the thing @tristan-breon-1 wants to do was one of the very first things I actually did.

One of the websites I built is at OurUrbanFarms.com. It is a website about living more sustainably. And one of the pages lets members submit “recipes” for making things at home, either food items, or other home-made DIY things. I capture the Nickname of the current user and use it for display purposes in the resulting page where the recipe is shown, which is a dynamic item page, like this [one:](one:

https://www.oururbanfarms.com/makeityourself/Raspberry-Jam)

[https://www.oururbanfarms.com/makeityourself/Raspberry-Jam](one:

https://www.oururbanfarms.com/makeityourself/Raspberry-Jam)

To accomplish this, you only need to add a dataset to form page of your members private data, make it read only. Because the current user can only see their own record (i.e. all other data in the members data is hidden from them) the result is a dataset that consists of only a single record. Looking up the nickname of the current user in that dataset is, therefore, really simple. This results in a dataset that has only one record in it.

It requires very little coding at all. It is super simple. You can connect user inputs to the dataset and you can reference any of the fields in the dataset in code. This implementation is not finished yet. But, I do plan to revisit it and finish it at some point. Even in its very crude form (which took zero coding) it works.

1 Like

“like shit one”

1 Like

@webmasterq Ha! Typing fast on the run this AM. TY.

xD