Need help: Getting userId from a viewed member's page.

Hello all. I asked this question a few months back but didn’t get any traction so I’m trying again rather than bump an old post. Currently I am displaying some user achievements in the the members profile area, using the wix members system along with some of my own databases. I have spent some time building workarounds to get around not being able to get the ID of the user whose profile is currently being viewed. This seems like it’s a nobrainer and there’s got to be a way to do this.

Does anyone know of a way to get the user Id of the member whose member page is being viewed? So for example if I send someone a link to the forum comments of a user I like, I need that someone to be able to click the link(regardless if if they are a member themselves) and get the actual Id of the person whose profile area they are viewing.

There is no solution too hacky. I will use whatever gets the job done. I’m using the url for the actual ‘profile’ page, but this breaks as the url in the members area doesn’t always have the id in it. Please help!

wixUsers.currentUser.id ?

Thanks for your response. That gets the id of the user who is currently logged in. I need to get the id of the profile they are viewing.

For example. Let’s say you have an account on my site. When people go view your forum posts, I need the browser to get YOUR id, the id of the person who owns the profile being viewed, not the logged in user.

Then you can either use wix-crm-backend. getContactById

Or you can use wix-data to look up the member in the Members/PrivateMembersData collection. Just use the getItem using the id you have in backend code.

However, remember that you need to make sure you have the relevant permissions from the site member before sharing their profile information. Hence - privateMembersData.

Note these are slightly different data sets so you need to use the most appropriate.

Again I appreciate the responses very much.

I am not trying to get the contact information. Getting contact information (via by id for example) via wix api is relatively straight forward.

Here is what I’m trying to do:

Imagine you come to my website and you’re looking at the forums. Then you click on a username and view some random member’s profile area. What I need to happen is for your browser to get the ID of the user whose profile you are looking at, so I can load other things associated with the user whose profile is being viewed. Does that make sense?

Did you manage to solve this one ? I have exactly the same requirement.