I have a notifications data type with a ‘seen’ field (Yes/No) and a ‘User’ field that is a list of users. The notifications are correctly displaying to all team members, but if any recipient marks a notification as seen, it is removed for all team members. Can anyone suggest a way to keep the notification visible for those who have not yet marked it as seen, even if other recipients have done so?
Hi there, @darren.james7518… one way to go here would be to have a field on the
User data type that stores a list of unseen notifications. Then, when a user sees a notification, remove it from their unseen list, and you’d be good to go.
As with all things Bubble, there are other ways you could go, but all of them are going to involve you doing something at the user level (which doesn’t necessarily have to be on the
User data type) so you can avoid the exact situation you described.
Hope this helps.
Thank you, Mike. I was thinking along the same lines, but I wanted to check with you first. It makes sense to have a ‘Seen’ field on the User data type, and then the ‘close’ workflow for the notification could set the ‘Seen’ field for the current user to ‘Yes’.
It seems that I would need to do something like '
close parent groups notification when current user's 'Seen' is 'Yes'.
I must admit, I am not completely clear on this concept, but I plan to experiment with it and see how it works.
A yes/no field on the
User data type won’t work because a user could obviously have many seen and unseen notifications. Because a user’s list of unseen notifications would likely be much shorter than a list of seen notifications, why not do what I suggested and have a field on the
User data type that stores a list of unseen notifications. Then, the ‘close’ workflow for a notification would simply remove the notification from a user’s unseen notifications list.
You could also consider storing a list of users on the notification who haven’t seen the notification yet. Then, when the ‘close’ notification workflow is run for a user, you would remove that user from the notification’s list of users who haven’t seen that notification.
Ah yes, it’s clicked for me! I think your suggestion will work well. Thanks @mikeloc this points me in the right direction for sure