Hide Button If No Content In Database (Repeater)

Try always first to clarify your project…

What we know?

  1. You are using a repeater.
  2. You are using a dataset (non-dynamic one) → at least you think that :grin:
  3. You are using buttons (which should be hidden when no data found in DB)
  4. Oh hell, yes you are also using a —> DATABASE.

But wait! How is now the relation between DB ↔ DATASET <—> and REPEATER?

You have now your DATA stored in your DB.
Your DB is connected by a DATASET to a REPEATER.
So you are able to manage DATA directly out of the repeater…

Simple example: for " email "-datafield…

const datafield = "email"

$w.onReady(function () {
    $w("#repeater1").onItemReady(($item, itemData, index) => {
        console.log($w)
        console.log(itemData)
        console.log(index)
        //----------------------------------------
        const repeatedData = itemData[datafield]

        if(repeatedData) {$item("#email").show()}
        else {$item("#email").hide()}
    });
});

If no entry in “email”-datafield, then element —> “#email” should be hidden.
Modify and expand this example for your own needs.