If statement not working

Hi

I have already posted but unfortunately still can not get this to work. Please help. My code is as follows:-

import wixData from ‘wix-data’;
export function RentText_viewportEnter(event, $w) {
let SLet = $w(“#dynamicDataset”).getCurrentItem().SLet;

if (SLet === false) {$w(“#RentText”).text = “POTENTIAL RENT”;}
else {$w(“#RentText”).text = “RENT”;}
}

The line in bold is just not working. Even the SLet’s in my database that are false, are showing on my website as “RENT” in the textbox (called “#RentText”).

Many thanks

Hi,

It is unlikely that your field key for ‘SLet’ is ‘SLet’;

Try ‘sLet’ or check your collection by clicking the field menu > Manage properties.

let SLet = $w("#dynamicDataset").getCurrentItem().sLet; //note the lowercase s