Notification for new updates

Hi Community,

I have followed the steps to create a notification using the Icon Badge (https://success.outsystems.com/Documentation/11/Developing_an_Application/Design_UI/Patterns/Using_Traditional_Web_Patterns/Numbers/Icon_Badge)  instruction. 


I would like to enhance it further:

1) Showing the number of unread submissions instead of the whole records.

2) Have a drop-down to show the details of the new submissions (Similar to FB's notification dropdown)

3) Reduce in number when submission is read.


Please advise on how I can do it?

Hi Alvin,

You will need to create another entity that is keeping track of which submissions have been read by which user. Use this table as a source for you counter. The counter will then "automatically" go down when a user has read a submission.

As for the pulldown, there are plenty of methods to do this. Perhaps the most easy widget for this is the Popover Menu or the Tooltip. 

This is high level what you can do to solve your problem. If you have any specific questions then please ask away :) 

Greetings,

Vincent

Vincent Koning wrote:

Hi Alvin,

You will need to create another entity that is keeping track of which submissions have been read by which user. Use this table as a source for you counter. The counter will then "automatically" go down when a user has read a submission.

As for the pulldown, there are plenty of methods to do this. Perhaps the most easy widget for this is the Popover Menu or the Tooltip. 

This is high level what you can do to solve your problem. If you have any specific questions then please ask away :) 

Greetings,

Vincent

 

 Hi Vincent,

Would like to know more about how I can go about tracking which notification is read.

Here are my thought processes, please feel free to critic them. 


1) I add a notification icon badge and make it a button that will activate a dropdown box.

2) I will create a "notification" table with columns: (All comes with an id which I will fetch from my main table)

i. id (1,2,3)

ii. Newly submitted appointment (912) / walk-in tickets (913) by the users

iii. Unread Tickets (120)

iv. Read Tickets (121)

v. EngineerWhoRead (100,101,102)

2) My notification count is linked to the number of Unread Tickets.count

3) My dropdown box will display Unread Tickets (120) columns

4) Each ticket in the dropdown box will have an On-Click destination that leads to the ticket and also trigger an update to the "notification" table and an Ajax refresh.

*update - Not sure how will the update be triggered and carry on its action.

Before clicked, a ticket will have the Unread Tickets (120) and the Read Tickets (0) 

*Once clicked, the Unread Tickets (120) in the table be (0) while the Read Tickets (0) will be (121) 

*EngineerWhoRead will be linked to the user who logged in (GetUserId())


Please advise.

Hi Alvin

To keep it simple, your notification table would need to have a "Seen" column which holds a boolean value determining whether the notification represented by that record has been seen/read. This should be set to False by default. 

There isn't a need to have columns dedicated to count unread or read notifications since you'll have to constantly maintain that data and that isn't necessary at all.

In the preparation of the web page / notification panel web block you should retrieve all notifications for the logged in user and use the ListFilter action to return the number of read and unread notifications by filtering "Seen" column.

When a user clicks on a notification item, an onClick action must be triggered and should take in the NotificationID as an input parameter and update the "Seen" column of that notification record to True. Afterwards you can choose to redirect the user to another page (where the preparation of the page will run again and you'll retrieve the updated notification count value in your panel) or decide to Refresh the Notification aggregate and ListFilters then run an AJAX refresh.

Ossama

 wrote:

Hi Alvin

To keep it simple, your notification table would need to have a "Seen" column which holds a boolean value determining whether the notification represented by that record has been seen/read. This should be set to False by default. 

There isn't a need to have columns dedicated to count unread or read notifications since you'll have to constantly maintain that data and that isn't necessary at all.

In the preparation of the web page / notification panel web block you should retrieve all notifications for the logged in user and use the ListFilter action to return the number of read and unread notifications by filtering "Seen" column.

When a user clicks on a notification item, an onClick action must be triggered and should take in the NotificationID as an input parameter and update the "Seen" column of that notification record to True. Afterwards you can choose to redirect the user to another page (where the preparation of the page will run again and you'll retrieve the updated notification count value in your panel) or decide to Refresh the Notification aggregate and ListFilters then run an AJAX refresh.

Ossama

 Hi Ossama,

Thank you for your advice.

Can you enlighten me on the List Filtered part? I have never done it before and because the "SeenTicket" is a boolean how should I input the source list and condition.


Notification Table:

GetSeenTicket_T_F:

Hi Alvin

I'm not sure what your GetSeenTicket_T_F action does however all you need to do is to load a Notification Aggregate and pass the resulting list into the ListFilter action. The ListFilter action also requires a condition, which in your case would be SeenTicket = True.

You can read more about this action here: https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/System_Actions#ListFilter

Ossama Ghanem wrote:

Hi Alvin

I'm not sure what your GetSeenTicket_T_F action does however all you need to do is to load a Notification Aggregate and pass the resulting list into the ListFilter action. The ListFilter action also requires a condition, which in your case would be SeenTicket = True.

You can read more about this action here: https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/System_Actions#ListFilter

 

 Hi Ossama,

Thanks for the help. Would like to ask how I can get the count value after I filtered the list. I don't see it in the result. 

Solution

Hi Alvin

The Length object is your count:

Solution