@code-queen well unfortunately the mission ain’t over yet ![]()
I’m getting the ‘Purchases’ database to populate with MemberID and PlanID.
I have another data collection called ‘Program Plans’ that houses all the relevant information for each program such as program number, title, description, purpose, background image for the repeater etc. I also have a reference field called MemberID from the ‘Purchases’ database to link the two data collections.
I have connected my repeater to the ‘Program Plans’ dataset to automatically populate it with all the relevant information.
When I try to filter based on owner = logged in user, on my live published site, I get a blank. And I guess that makes sense, because in this case, the content hasn’t been created by the logged in user.
Instead, when I try to add another filter…this time using MemberID (from Purchases data collection) as a reference field in the ‘Program Plans’ data collection, I am unable to add it as I get the message “none of your current datasets are valid for this filter”
From further digging on the forum, I realize I need to add some additional code for this to work. I have added this so far…
let user = wixUsers.currentUser;
let userId = user.id;
wixData.query( “ProgramPlans” )
.eq( “_id” , “user.Id” )
.find()
.then( (results) => {
if (results.items.length > 0 ) {
let items = results.items;
Am I heading in the right direction? I’m still unclear on how to actually filter the repeater content based on logged in user. Would appreciate some guidance. Thank you so so much.