Sort table by user email

Hello Chris,

Try the code I have posted below, I narrowed it down to two possible errors:

  1. The email you are filtering is not the one that is in the collection. (I put a console.log to check the email)
  2. You are not consuming the promise that is returned by filtering the dataset. (using .then() after filtering)
import wixUsers from 'wix-users';
import wixData from 'wix-data';

$w.onReady(function () {
 
   $w("#dataset1").onReady( () => {
    wixUsers.currentUser.getEmail()
      .then((email) => {
         console.log(email, 'here is the email being sent to filter');
         $w("#dataset1").setFilter(wixData.filter()
          .eq("email", email)  
         )
         .then( () => {   
         console.log("Dataset is now filtered"); 
         })
         .catch( (err) => {   
         console.log(err); 
         });    
      });
  });
  
}); 

This code should solve those two problems, see the console log to see if the email is correct.

Best,
Majd