I’m missing something here. No matter what I try I can’t get this numbered field to populate correctly in the console and thus am unable to push it to my page’s text field. Can someone take a quick look at this for me?
function currentbelt () {
wixData.query("multiStepRegistrationForm4")
.ascending('copyOfDateAwarded')
.find()
.then( (results) => {
let verified = results.items[0].verified;
let awardDate = results.items[0].copyOfDateAwarded;
let degree = toString(results.items[0].copyOfWhatIsYourBeltDegree);
/* Failed attempt to use const
const degree = results.items[0].copyOfWhatIsYourBeltDegree;
*/
let affiliate = results.items[0].copyOfWhatAffiliationWasThisBeltIssuedUnder;
//ties text element to collection data
$w("#beltDegree").text = degree;
$w("#affiliatetext").text = affiliate;
$w("#awarded").text = awardDate;
//Test elements are assigned
console.log(degree);
console.log(verified);
console.log(awardDate);
//code expands an object that acts as a user indicator that the entry must first be verified
if (verified === false) {
console.log('Pending should show');
$w('#peindingVerification').expand();
}else if(verified === true){
console.log('Pending should not show');
$w('#peindingVerification').collapse();
}
});
}