Show if no data

I have a Pay button which should be shown if T_payments has no results. Can‘t I use the opposite or like „!=„ ? of course I can change code directly. But prefer to go via wappler

I saw the expression: HasItems but not the opposite? Now I do a workaround and the opposite with my button. Payment button is loaded per default. Then hide the payment button IT HAS results. The effect is now, that even when paid in DB my button will be shown for 0.5 seconds :sweat_smile:.

Use hasitems() but use show or hide as appropriate so show if NOT hasitems() becomes hide if hasitems()

Make sense?

makes sense, but u mean i put that just as an expression within a conditional field? (App Conn)

a condition Within the Dynamic Attributes of the button, i.e.

show button condition is : serverconnection.data.query.hasItems()? 1:0

(or reversed depending on what you need to do)

Freddy, just use dmx hide with the hasitems filter.
So when there are items the button will be hidden, otherwise shown.

Ill try the above solution. As i have now that situation:

  1. Pay Button showed
  2. Check if payment is done
  3. Hide Pay Button

So step 2 shows me quickly the button and the dmx is loaded and hides button. Not so clean, thats why I try @Hyperbytes Solution. Maybe I missunderstood it…?

Freddy,
show when hasitems will show your button when your query returns items.
hide when hasitems will hide your button when your query returns items.

No its the opposite, if no items then show. As no items means, no payments found. But tomorrow I‘ll give it a new try! Thanx for beeing patience. That upload imageLoad will also check it this week again.

That is what I am saying:
Dynamic attributes > hide > when hasitems will hide your button when your query returns items. So it will show it when no items...

What happens if we use Show and Hide on the same element?

eg. Show if user is logged in AND Hide when hasitems is true