Can you apply two filters to a dataset?

Hi guys, need some help please. I have a dataset that I’m wanting to filter by user email, ie only showing that members information. Then I need another filter applied to only show events now and in the future.

I’ve put in the below code (thanks to other members help!) and I’m successfully filtering by member email, but not the date filter. Any ideas, suggestions, tutorials etc Appreciate any and all help. Thanks.

$w.onReady( function () {

let user = wixUsers.currentUser;

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

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

  $w("#events").setFilter(wixData.filter() 
    .eq("email", userEmail) 
  ); 
}); 

});

$w.onReady( function () {
// filtering by the date in Screening Date & Time.
var today = new Date();
$w(‘#events’).setFilter(wixData.filter().ge(‘screeningDateTime’, today));

});

Just add another condition to the setFilter and you are good to go

$w("#events").setFilter(wixData.filter()         
  .eq("email", userEmail)
  .ge("dateField", new Date())
);

Brilliant!! Thanks so much, works a treat.

Could I trouble you to show me how to write it to filter for previous dates? I believe the .ge needs to be different - is that right?

Thanks again, you’re a legend.

Hey thanks, I found the answer myself. I just scrolled through all the functions that came up in the Page Code after entering ‘.’ and there it was.
Thanks again for your help!!

@claytonrmorgan No problem, I am here to help