How can I check if the response of a server connect database query is blank?
I would like to toggle visibility of a “No Records Found” element based on response of the query. Please help.
Select your “No Records Found” element and add new dynamic attribute > display> show > and select your query as an expression.
Click the formatter icon, under conditional select Has Items:
Click ok and then add a
! in front of the expression, so it becomes:
!serverconnect1.data.query1.hasItems() This means show the element when the query does NOT have items.
Could you point me to some documentation where I could understand how these expressions work in context of App Connect?
You can find the documentation here: https://community.wappler.io/c/docs
We are constantly updating it, so slowly we are filling the missing topics…
For anybody in the future who’s interested in this topic - here’s a link to the how-to guide explaining this in our docs: Show a Message when Query Returns No Results
Wouldn’t it be better to use the HIDE attribute and hide it when result has items?
It’s the same
Whatever you find easier.