Yes sorry…i will try to be more precise
This is the user personal page and all the text input are connected to a dataset read/write, like this the user can see and update his personal record in gym excercise,
I found a tutorial for filtering the data depending on the logged in user import wixUsers from ‘wix-users’ ; import wixData from ‘wix-data’ ; import wixLocation from ‘wix-location’ ;
$w.onReady( () => {
//questa funzione sempre attiva da il testo login oppure logout if (wixUsers.currentUser.loggedIn) {
$w( “#login” ).text = “Logout” ;
// $w(“#UpdateButton”).show();
// $w(“#ProfileButton”).show();
} else {
$w( “#login” ).text = “Login” ;
//$w(“#UpdateButton”).hide();
//$w(“#ProfileButton”).hide();
}
} );
export function login_click(event) {
// user is logged in if (wixUsers.currentUser.loggedIn) {
// se utente è loggato fa il logout
wixUsers.logout()
.then( () => {
// update buttons accordingly
$w( “#login” ).text = “Logout” ;
//$w(“#UpdateButton”).hide();
//$w(“#ProfileButton”).hide();
} );
}
// user is logged out else { let userId; let userEmail;
// prompt the user to log in
wixUsers.promptLogin( { “mode” : “login” } )
.then( (user) => {
userId = user.id; return user.getEmail();
} )
.then( (email) => {
// check if there is an item for the user in the collection
userEmail = email; return wixData.query( “Members” )
.eq( “_id” , userId)
.find();
} )
.then( (results) => {
// if an item for the user is not found if (results.items.length === 0 ) {
// create an item const toInsert = {
“_id” : userId,
“email” : userEmail
};
// add the item to the collection
wixData.insert( “Members” , toInsert)
. catch ( (err) => {
console.log(err);
} );
}
// update buttons accordingly
$w( “#login” ).text= “Logout” ;
//$w(“#UpdateButton”).show();
//$w(“#ProfileButton”).show();
} )
. catch ( (err) => {
console.log(err);
} );
}
}
What i want to do is to intercept manipulate the data A and B and save the result in C…like this i can store the result for each user.
You can get the contents of the two fields (“A” and “B”) from your query. Once you do whatever manipulation you want, just put that result in “field C” of the item object, and then do an update() .