[solved] Hide a entire strip based on an empty column from Data Set on a dynamic page

I have a dynamic page that displays text, image, and video.

I would like to hide the entire strip that contains the video,
if there is no video url(youtube) on my data set.

why is below code not working? somebody please help :sob:

$w.onReady(function () {
    $w("#dynamicDataset").onReady(() => {
        var item = $w("#dynamicDataset").getCurrentItem();
            if (currentItem.video) {
        } else {
$w.onReady(()=>{console.log("Page is ready!");
    $w("#dynamicDataset").onReady(()=>{console.log("Dynamic-Dataset is ready!");
        var currentItem = $w("#dynamicDataset").getCurrentItem(); console.log("Current-Item: ", currentItem);
            if (currentItem.video) {console.log("IF-Statement running!"), $w("#columnStrip1").expand();}
            else {console.log("ELSE-Statement running!"), $w("#columnStrip1").collapse();        }

Thank you soooo much!!! It works perfect :smiley::man_bowing: you saved my life :sob::sob::sob::sob:

Can I ask you a favor… if you dont mind,
Could you please help me to add one more field to collapse the strip like bellow?
(I would like to hide the strip if both videos are empty.)

if video and video2 fields are empty, columnStip1 will expand
and if video and video2 fields are NOT empty, columnStip1 will collapse


      var currentItem = $w("#dynamicDataset").getCurrentItem(); 
      if (currentItem.video && currentItem.video2) {
         $w("#columnStrip1").show('slide', {duration500});
      else {
         await $w("#columnStrip1").hide('slide', {duration500});

With some additional stuff for the —> Cat! Let’s dance!

1 Like

Hi Lamy,

This question has been asked hundreds if not thousands, you should have searched the forum first.