Separating Data based on user (Content posted by Admin)

I’ve been playing around with different ideas and looking on forums and the wix site, however I still can’t seem to find how to do this.

I have different “postings” that I want my users to be able to see. Each “posting” is assigned to a certain person, however they do not make their own. The inability to change the Owner of the post makes this much harder of a task.

I don’t have any code on separating the posts, just calling upon the users data. See Below:


import wixUsers from ‘wix-users’;

let user = wixUsers.currentUser;

let userId = user.id; // “r3cme-6fem-485j-djre-4844c49”
let isLoggedIn = user.loggedIn; // true

user.getEmail()
.then( (email) => {
let userEmail = email; // “user@something.com
} );


This is what I currently have for gathering the users data.

You will need to store the users email or userId in your “postings” Data Collection and then you can filter in that field. I would store the userId because then you can use filters in Datasets for logged in user.

So in your “admin form” page paste in users userId in a field.

I should also create a new Data Collection called Users and whenever someone logs into your site I would add that user and their email to that data collection so you later can have a dropdown or something where you can select the user without going to contacts & crm and get the userId the hard way.