HI
I have this code that pulls from my database 3 fields based on the drop down selection of long name. Email adress = works fine Firstname = works fine
However the currentWeightInKG wont pull and place in my text box. im assuming as its a number not text.
Can someone help with the code i know im good as the consol log shows me the current weight i just cant place it in the text box. it says undefined in the actual text box no error.
$w(“#weightText”).text = String(item.currentWeightInkg);
CODE
//longname to email adress dropdown event
export function longNamedropdown_change(event) {
return wixData.query(“MemberProfile5”)
.eq(“longName”,$w(‘#longNamedropdown’).value)
.find()
.then( (results) => {
let items = results.items;
let item = items[0];
let email = item.email;
let firstName = item.firstName;
let currentWeightInKg = item.currentWeightInKg;
$w(‘#emailAddresstext’).text = item.email.toString();
$w(‘#firstNametext’).text = item.firstName.toString();
$w(“#weightText”).text = String(item.currentWeightInkg);
console.log(email,firstName,currentWeightInKg);
} )
. **catch** ( (err) => {
let errorMsg = err;
console.log(errorMsg);
})
}
Thanks