Using repeaters, how do I hide a box if a text value within it has no value

Hi,

I am trying to create a ribbon on my product dynamic page, and I can’t figure out how to use code to hide the container box if the text value within the dataset is empty.

Can someone help?

Hello,

Is your repeater connect to a dataset or are you populating the repeater based on a query?

Either way, your approach is similar but you can do something like this:

$w.onReady(function () {

	formatRepeater()

});

function formatRepeater() {
	$w('#dataset1').onReady(() => {
		$w('#repeater').onItemReady(($item, itemData, index) => {
			// if item data exists expand the elemend, else collapse it 
			itemData.MYVALUE ? $item('#myElement').expand() : $item('#myElement').collapse()
		})
	})
}