Client Dashboard Question/Help for 2 Step Sign Up

Hi all,
I am building a marketplace and am having trouble figuring out how to connect two databases to display the correct information in a repeater that would show up on a client’s dashboard.

I have a two step process to create a new project.
Step 1 - Collect Project Details - Data goes into a Project Details collection
Step 2 - Collect Client Details - Data currently goes into the PrivateMembersData collection

  • I have thought about creating a Members database to give myself more control, but I don’t know if that solves my problem and I’m not sure how that interacts with the PrivateMembersData collection.

I can currently get the user logged in and to the Dashboard which is populated with a project from the Project Details collection, but I am not sure how to link that user to the record created by that user in the Project Details collection and the ONLY show that project(s) created by that user.

I have thought about making a hidden field for the ‘_id’ on the 2nd Step to collect and trying to link that to the user data, but I do not think that solves anything.

I am not sure if I have set this up in a way to make this possible. Any help or guidance is appreciated!

Below is the code I have used to register a new user (Step 2).

import wixUsers from ‘wix-users’;
import wixLocation from ‘wix-location’;

$w.onReady( function () {
$w(‘#next’).onClick( () => {
let emails = ;
let phones = ;
let labels = ;

emails.push($w(‘#email’).value);
phones.push($w(‘#phone’).value);
labels.push($w(‘#hiddenLabelID’).value);

// register as member using form data
wixUsers.register($w(‘#email’).value,$w(‘#password’).value,{
“contactInfo”: {
“firstName”: $w(‘#firstName’).value,
“lastName”: $w(‘#lastName’).value,
“emails”: emails,
“phones”: phones,
“HTHAU”: $w(‘#hthau’).value,
}
})
.then(()=>{
wixLocation.to(‘/account-client-dashboard’);
})
})
})

Here is an image of the Dashboard.

You can use insertReference to link the data between the two collections. Alternatively, you can create a reference field in the Project Details collection and use insert to link a user to their data by inserting their ‘_id’ to the reference field.