How Can I provide a custom URL for each logged in WiX User?

Hi guys,
I have a WIX log-on/members page for my site where clients have to register before they proceed to book an online class (using WIX Bookings)
When we take a booking I want to provide the client with a unique URL that will only appear on their profile page when they have logged in so they always know where to find the link to the class.

I have been able to successfully set this up by creating my own login page using Wix Code and manually entering the room name and URL directly into the database, then presenting it on a button using the Dataset option, but I can only make this work if they use my logon page/process which I don’t want to use.

I can’t access the Wix Users database and import the user information that I need when exclusively using the Wix Members app. (the database is hidden)

Can anyone please tell me how to import or connect the WiX Users database information into my WiX ‘Members’ database so I can create a page that does what I need.

Or alternatively, does anyone have a better solution as to how I can provide this unique link to each user in another way when logged in via dynamic page, button or other magic trick?

Thanks.
Jason

p.s. my coding skills are average so examples would be good if you have them. :wink:

1 Like

Hey Jason. I am also wondering how to tap into the Wix Members database and call data from there, if possible. I also don’t have the best coding skills. I have Wix Code team and Nayeli/Code Queen to thank for everything I’ve been able to build myself, which is WAY beyond my expectations. I don’t have the complete answer to your issue but this discussion may be of help.

You can have the page so that it is accessible to everyone and have it run a current user check, which will then redirect or display the appropriate data that is necessary.

STATIC PAGE
CODE TO CHECK IF USER HAS ACCESS TO A PAGE:

import checkAccess from ‘public/check-access’;
$w.onReady(() => {
return checkAcccurrentess();
});

CHECK THE USER/MEMBER ACCESS FILE:

import wixLocation from “wix-location”;
import wixData from “wix-data”;
import wixUsers from “wix-users”;

export default function checkAccess() {
if (!wixUsers.loggedIn) {
// no user is logged in
wixLocation.to(‘/’);
return new Promise(() => {});
}
return wixData.get(‘user-access’, wixUsers.currentUser.id)
.then(res => {
if (res && res.group === ‘a group with access’) {
// the user has access to the page
return Promise.resolve();
}
// the user does not have access to the page
wixLocation.to(‘/’);
return new Promise(() => {});
});
}

I think you can use this to tie in what you need. But I would also LOVE for someone to share how to call data from Wix Members, such as usernames, join dates, posts, post dates, follows, likes, shares, etc.
I thank anyone in advance for contributing.

I hope this helps Jason.

Nelson

Hi Nelson,
Thanks so much for this information, I really appreciate you taking the time to put it all together for me.
Yeah, my coding isn’t great either but can I ask, where is the best place to put this code? Create a dynamic page and put it in the Page code or just straight into the Site Code?

I’m going to have a good look over it and the associated posts that you linked and see if I have any luck.

I totally hear you on that last point, it would be so much easier to just tap into the Wix Members database as this would make it so much easier but not for now it seems.

Thanks again mate.
J