Accessing dynamic page created after Stripe subscription.

The code below is a snippet from my subscription site using Stripe. I can access the member’s dashboard by clicking the id link in the dataset. However, I cannot figure out how to get the member’s dashboard with wixLocation.to.
Any ideas?

function confirmInsertSuccess(response, cus, lastFour, brand, subStatus) {
let data = {
firstName: $w( “#fName” ).value,
lastName: $w( “#lName” ).value,
email: $w( “#email” ).value,
customerId: cus,
subscriptionId: response.id,
lastFour: String(lastFour),
cardType: brand,
subscriptionStatus: subStatus
};
wixData.insert( ‘payingMembers’ , data)
.then( (result) => {
let item = result;
wixLocation.to(/my-dashboard/${item._id}); //redirect to member page (dynamic)
});
}

The redirect works after they subscribe. However, I would like to put a button on my home page that redirects to the member page.

I tried to no avail:


export function button2_click(event) {
wixLocation.to(`/payingMembers/${wixUsers.currentUser.id}`);  
}

Thanks!

Hi,
you can either link a button using regular editor functionality, as shown here .

Or, if you have a custom members area, you can get the link from the database connected to its dynamic dataset.

Thanks! But I actually would like to redirect to the page onready. So these solutions will not work for me.

It’s weird it is sending me to the _owner field key instead of the _id field key