Hi,
This is driving me crazy! I simply want to format #boxName depending on a particular value in my dataset. Eg. If ‘approved’ = 1 then style the box white, else style it blue but it is always returning “not approved” (in the console log) and therefore is skipping my if statement presumably because it is only looking at the first row in my dataset?
How do check all rows?!
wixData.query("MembersOnly")
.find()
.then((results) => {
let valueApproved = results.items[0].approved;
console.log(valueApproved);
$w("#rptMembers").show();
if (valueApproved === "1") {
$w("#boxName").style.backgroundColor = "#FFFFFF";
console.log("approved");
} else {
$w("#boxName").style.backgroundColor = "#7FCCF7";
console.log("not approved");
}
})
}
Thanks,
Rachel