Show elements only if text box has data

How can i make it so that ITEM2 box in the image only shows if ITEM2 has data?


So basically

On my form ITEM2 isn’t required, it’s an extra field incase they want to add another item.

If item2 doesn’t have any data submitted, how can i hide the item 2 box and text element?

you may use item.length to do so

let a = $w(“#dataset”).getCurrentItem().item2data;

If ( a.length < 1 ) {
$w(“#item2box”).ccollapse();
}