Showing an Element based on Data

Hello again,

I would like to know how to show an element, specifically an icon as i am using this as a notification to tell the User that he/she has one or more.

I created a new Data type to make it easier for me aptly named Notifications. Now when trying to set the condition for this icon element to show, i cant get it to work correctly. See images below…

The Data type i created

The icon with the condition for it to be visible

If i used “:last item” it would work but if i have multiple notifs that have the Read = No then it wont show anymore. Still a little confused with the “do search for” so yeah… im lost. TIA!

A search returns a list of data. If it finds data it will have a count > 0, otherwise the count will be 0.
A condition requires a yes/no, so your expression need to ends with something that returns a yes/no value.
If you want to show the icon when you find notifications in the database you just need to add a condition on the count of your search: search for notifications :count > 0


1 Like

Okay, i did this but it still shows even when there are no notifications for the current User

edit: Nevermind, i forgot to untick the visible on page load option.

Thank you so much for the detailed explanation!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.