I have a repeater setup to display our services. We offer services in multiple categories including Waxing, Facials, Speciality Facials, Tanning & Body Treatments. In my dynamic dataset I have a boolean field setup for each category and true if it fits that category. On my repeater I would like to display the label based on what category the service item is in. (Ex: If service item is Brazilian Wax show the label as Waxing because Waxing boolean equals True ).
The following code works but I am not sure how to adapt this for multiple boolean fields.
Fields: (waxing, facials, eyebrow, airbrushTan, bodyTreatments)
$w.onReady(function () {
$w("#dynamicDataset").onReady(() => {
$w("#listRepeater").forEachItem(($w) => {
const booleanValue = $w("#dynamicDataset").getCurrentItem().waxing //change this field name
if (booleanValue === true) {
$w("#buttonWaxing").label = "Waxing";
} else {
$w("#buttonWaxing").hide();
}
})
})
})
Thanks for any help in advance.