What you can do is that you can get the profile slug from the page.
const slug = wixLocation.path[0]; // Assuming URL structure: /profile/{slug}/profile
if (slug) {
loadProfileBySlug(slug);
}
async function loadProfileBySlug(slug) {
const memberData = await wixData.query(“Members/FullData”)
.eq(“slug”, slug)
.find();
}
The slug is unique, so you can then use it to query the memberData from the slug.
Then you can implement any custom logic as you have the userID which is (and should be) your main reference for most of your databases.
Note, you can only query the FullData database without user being logged in.