Retrieving user data from DataSet

Hi,

I have three text fields, an image container and a table, all linked to a DataSet. The user logs in to the page and the DataSet is filtered to show only the record containing that user’s info. The table automatically updates, but the textfields and the image container don’t. Any ideas as to why?

Here is the code.

import wixData from “wix-data”;
import wixUsers from ‘wix-users’;

$w.onReady(function () {

let user = wixUsers.currentUser; 
let msg = user.getEmail() 
	.then((email) => { 
		let userEmail = email; 

		$w("#dsStudents").onReady(() => { 
			$w("#dsStudents").setFilter(wixData.filter() 
					.eq("email", userEmail) 
				) 
				.then(() => {}) 
				.catch((err) => {}); 
		}); 

		$w("#dsCourses").onReady(() => { 
			$w("#dsCourses").setFilter(wixData.filter() 
					.eq("email", userEmail) 
				) 
				.then(() => {}) 
				.catch((err) => {}); 
		}); 
	}); 

});

Furthermore, in PREVIEW and in LIVE modes, I get two different results. Why???

1 Like

I’m having a similar problem :frowning: