For my site, I have a custom member page. On that page, I want to be able to store transactions that the currently logged in user has placed, but I only want them to be able to see it. Is it possible to automatically create a database for each member on the site based on their member ID or some other unique identifier that only that members information is stored to? An initial collection won’t work because I need members to be able to submit as many transactions as they want.
A single database would work as well just so long as users will be able to see the data on their page and that their information will not be stored on anyone elses.
Yeah, but in that case the member would have to submit his/her own information. I think that what @anneynorton7 is referring too is pretty much the same issue im having.
We (admin) create and submit the content for the members, and then isolate those transactions so only the ones pertaining to the logged in user show in the page.
Correct?? If so, let me know if you can come up with a solution im stuck in that area too!
Hi @tanya11 , I couldn’t find a “right” way to do it but I got it to work.
So the fist thing is to identify what will be driving the information from the database to the page. In my case I used the Email field as primary. And used the code below to only show info pertaining to the Logged In member.
import wixUsers from ‘wix-users’;
import wixData from ‘wix-data’;
$w.onReady( function () {
//Get current user email address
wixUsers.currentUser.getEmail()
.then((Email) => {
let userEmail = Email; //"user@something.com"
//Filter the dataset
$w(“#dataset1”).setFilter(wixData.filter()
.eq(“Email”, Email))
})
});
I should add that you will need to approve each member individually, and do so only after you have some kind of information on the database about them. Otherwise it will show you whatever is available as 1st record on the sandbox/live data.
To avoid that, create a “Sample” record and add a “sort” rule to your dataset. That way your Sample info appears on top always.