Can I show/hide content from a database on a dynamic item page based off of whether a boolean field is checked?

@wingcc hi there, I’m hoping you could help me with this code a bit. Same boat as above but I’m only trying to pull in some text, no container box. Also a novice with code.

When the boolean ‘reserved’ is checked (true), I would like the ‘reservedText’ to show up. See screenshots too. I added an additional dataset because this page is dynamic… not sure if I needed to. Any help is appreciated!

The code I have inserted is:

$w( “#dataset1” ).onReady(() => {

let items = $w( “#dataset1” ).getCurrentItem();

if (items.reserved === true ) { $w( “#reservedText” ).show(); }
else {$w( “#reservedText” ).hide();

}