Filtering A Table By Login User

Hi,
I am trying to set up the member login area so that they can see their clients in the account. I keep running into an issue with filtering the dataset to set up the Filter as Consultant is Login User. I was trying to code it, but because I am a beginner I keep getting errors and am probably doing it wrong.

Here’s a screenshot of how it is showing up right now. I wanted the rows to only show if the Consultant name matches the login user. As you can see it is still showing the row with Admin Not B even though the consultant doesn’t match the login user.

Thank you

1 Like

If you have used any code on this page then you need to be adding it to your forum post to begin with.

First off, if you have this table connected to a dataset that you are filtering, then you can see if you can simply filter the dataset through it’s own settings like as shown here.
https://support.wix.com/en/article/filtering-database-content-displayed-on-your-page

Note that you are using the Wix Members app already and so that is setup automatically to be specific to the logged in site member only.
https://support.wix.com/en/site-members/setting-up-a-members-area

So if you use the Wix Members collection that gets added to your site automatically when you add the app itself, then note that you are limited to what you can do with it as shown here.
https://support.wix.com/en/article/corvid-wix-members-privatemembersdata-collection-fields

If you use your own dataset for this table then you won’t have any restrictions, however you can bypass them with Wix Data Options.
https://www.wix.com/corvid/reference/wix-data.html#WixDataOptions

So to do this in code you can simply get the logged in members name and then just query that name in your dataset so that it filters the table to only show the matching name.

Or if the logged in user is the same person as the name that you are wanting to show, then you can simply just filter the dataset to show the logged in users info only by using their userID.

Finally, you can create your own member profile pages as shown in this tutorial here.
https://support.wix.com/en/article/corvid-tutorial-building-your-own-members-area

Note: I removed any code I added to this page since I kept getting errors.

So if i try to add a filter the closest thing I can get to show data for logged-in users, is if the field is setup as owner. But I would like that field to be the consultant.

So it would be
Field: Consultant
Condition: Is
User: Logged-in User

But when I change the field to consultant it doesn’t give me the option for user: Logged-in user. See screenshot.

Note: I can’t filter by owner since the logged in users aren’t inputting this information in. Someone else on the team adds this information.

Hi Barbara,

Struggling with the same issue when trying to display specific data to specific users.
Have you figured out a way ?

Thanks a lot
Best
Noé

Nobody?

@aynur-9 Please open your own Post, with your own issue. You can link this topic to your Post if needed.

Describe your issue and your aim as most detailed, as possible.

Then you surely will get some help.