Filter repeater by current user

I have two databases, first is a database of applications and then a database of installers. On a member page which is driven from the installers database, I want a repeater, based on applications set up to only show that logged in users assigned data only. Any ideas?

You can just do something like the Wix Member Profile tutorial as shown here.
https://support.wix.com/en/article/corvid-tutorial-building-your-own-members-area

Just take the tutorial and only do the single dynamic page that is read only, so when the member is logged on, then they will be the only one who is able to see their own dynamic page and the repeater should only show data that is linked to them by their userid for example.

https://www.wix.com/corvid/reference/wix-users.html#currentUser
https://www.wix.com/corvid/reference/wix-users.User.html

Hey I’m facing the same issues and need to pull out the items from a database which references users and show the data referenced to that particular current User. Please help! Is there a code for it ?

1 Like

You can do this either by filtering the dataset when it’s ready or by refining a query.

Start by importing Wix Users and Wix Data API modules.

import wixUsers from 'wix-users';
import wixData from 'wix-data';

let user = wixUsers.currentUser;

Method #1: Filteriing a dataset

let myFilter = wixData.filter().eq('member', user.id)

$w('#dataset').setFilter(myFilter)

Method #2: Refining a query when using data bining

wixData.query('collection').eq('member', user.id).find()

For other questions please open up a new thread.

Ahmad