Get username from user ID!! [wix-users]

Hello,
Is it possible to get the username from user ID ? An example use case would be the Review example (https://www.wix.com/code/home/example/Reviews). currently in that example only a anonymous review is posted( I mean, anyone can type any name and post anything). But there is no information who posted it.

It would be great if there is an option to get the username from the user who added that review and link it to his profile in the members profile page for authenticity . Thanks.

3 Likes

Checkout this article.

Add a username or full name to your users profiles and then just display it. There is no username default stored from WIX, Google or Facebook login.

The closest is the e-mail but I don’t think you wanna post that on your page.

1 Like

Thanks for your reply.But I don’t want to make my own user profile page as its already provided by wix. It would be great if wix has an api for accessing the built in default member profile page and its contents so that i can use them in my application.

But your link helped me have an idea about updating the user content as i was having some issues in that topic.Thanks.

1 Like

also interested !

Hi,
There is no username,
By Wix Users API there is member id, member role and member email.
For more information,
https://www.wix.com/code/reference/wix-users.html#currentUser
Roi

That’s a shame, it would be awesome to be able to get the current user’s name to use it for something like a review or anything related to UGC

1 Like

Hi,
In what case do you need the username ? What are you trying to achieve ?
Feel free to add a feature request here .
Roi

Users have the ability to post content on the website, which contains a title, a description, an image, a price etc. and I want their username, after they logged in, to be added to the entry the have just created.

All this data is then displayed on a dynamic page, and I want their username to be displayed to know who posted what.

I’d love their username to be clickable so anyone can access their profile, but that’s another story.

To put it simple, it’s like creating a forum, when one is logged in, they have the ability to post a thread, and their username is displayed with it.

1 Like

Why not to add a field called username ?
Roi

That’s what I have for now, but it doesn’t make any sense : let’s say the user logged in under the username of ‘Simpson’, he’ll be asked to type his username in the ‘Your username’ field again, and then again, he can type anything, like ‘Roger23’ !

bump

let’s say the user logged in under the username of ‘Simpson’, he’ll be asked to type his username in the ‘Your username’ field again, and then again, he can type anything, like ‘Roger23’ !

Simply just hide the username input if it’s not empty. I did that to avoid updating. Though i have other problems as you know :slight_smile: Just put in the following:

if ($w("userinput").value === "") {
  	$w("userinput").show();
  	$w("profilebutton").hide();
  	$w("updatebutton").show();	
	}

else {
	$w("userinput").hide();
	$w("profilebutton").show();
//if you completely want to disable updating once a username is created
	$w("updatebutton").hide();
				
	}
}

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

4 Likes

I have a problem displaying the username of a buyer on the thank you page of my wix store. I am not sure if the username appears automatically or i need to put some lines of code in the wix developer section. Please what do i do?

How can I display the e-mail?