Hide / Collapse items that are not present in the database

I’ve been struggling with this when using a repeater. If the dataset returns a number of records, the above code only checks the first item.
For example: I have a dataset called “newsDataset” with 7 records, 3 of which have a URL set for video and 4 which don’t. I want to hide or collapse the video if the URL is not set.
My code reads:
$w.onReady(() => {
$w(“#newsDataset”).onReady(() => {
// Gets the current item properties and stores them in a variable called item
const item = $w(“#newsDataset”).getCurrentItem();
// Checks if the current item has a value in the “videoUrl” field
if (!item.videoUrl) {
// Hides the video if there is no value for “videoUrl”
console.log(“Hiding”);
$w(“#video1”).hide();
}
else {
console.log(“Showing”);
$w(“#video1”).show();
}
});
});

When I preview this I only see “Showing” once in the console log. So it seems to only check 1 record - not each of them. Do I need to create a loop? Any help much appreciated.