Hide element after refreshing or navigating

Hi there,

I have a notification icon in the header of my app. When a profile gets a new view, the icon displays a number.

After a user expands the notification button, I want to remove the numerical display. When I ‘hide the element’ in the workflows, it hides it for while the user is on the same page.

Two things (likely would have the same solution):

  1. When they navigate away from the page in the same session, I want it to be also be removed.
  2. When a user exits the app and comes back later (new session or refreshes), I similarly want it to stay removed.

If anybody has an example of something similar, I’d appreciate knowing how the workflows were created.

Thanks!

Hey ! Have you found the solution ?! I’m interested !!

Hi @agathe
One way to do this would be to

  • have a property on the User eg “has viewed?” yes/no (default to no)
  • On page load (before setting the has view to yes) set the screen element to be visible if “has viewed? is no” then,
  • on the same page load workflow set “has viewed?” on that User to yes

I use this technique for “welcome first-time user” for example.

Interesting ! But does it work when another notification is had to the data base ?
For example, my user have 2 notifications. He sees on the app “2” notifications and clicks to have more detail about them. We can consider those 2 notificarions as “read”
Few moments later, another notification is added to the data base, is he going to see a notification “1” because he as already seen the first two ? :roll_eyes:

Same technique would work, but you’d need to think about the notifications as a List, not a single yes/no variable. The presence (list contains) of a notification on the list indicates the notification has been read/seen/shown.

Then as each Notification is read, add it to the list of read notifications. (after the notification has been revealed" ) and use “list does not contain notification” to test on page load whether to show the notification or not.

Make sense? Bit hard to describe really :slight_smile:

Yes I get what you mean, I’ll have to try it !!
Thanks for the help !

1 Like