Filter collection by current user email

I have a collection “WorkOrders”. I wish to display items in a table from “Work Orders” that match the current users email address to a field in the collection named “customers”.
This table is to sit in a separate members page called “My Work Orders”.

I have used code from a similar article:

but I cant get ti to work.

Any help is much appreciated!

David, could you show us your code, that would make it a lot easier?

Hi Giri,

import wixData from ‘wix-data’;
import wixUsers from ‘wix-users’;
$w.onReady(() =>{
let user = wixUsers.currentUser;
let customers = user.getEmail()
.then((customeremail) => {
let userEmail = customers;
wixData.query(“WorkOrders”)
.eq(“customers”, userEmail)
.find()
});
});

@davidlist Hi David!
What are you doing with the query results?
It seems like you stopped half way through.

Doron.

@doron-alkalay oh, this may be where I’m going wrong. I need to display the results in a table.

@davidlist Hi,
You can display the results in a table with simple coding, check out the API here .