524
Views
9
Comments
Solved
How to add in-App notifications in outsystems Reactive Web Application?
Application Type
Reactive
Platform Version
11.19.0 (Build 38072)

Good evening,
I am trying to add notifications to my App, but the documentation isn't clear enough: 
I don't know from where the Notification.Id comes, I couldn't find it. 
Shall I create an Entity named Notification ? And if so, how could it be a WidgetId?


2023-01-19 15-05-03
Sirajeddine Bouasker
Solution

Hi , 
I have used this many times, simply use a Client Variable: ShowNotif (boolean) and set it to true when your condition is true (for instance: GetOrders.Count >5) 
then in the StartsOpen field put: Client.ShowNotif.

It should be enough to get it working.
On the other hand, as Sergio has said, you don't need to add an Entity Notification (it depends on your usecase, it might be useful, but in general it is not mandatory)

Kind regards,
Sirajeddine

UserImage.jpg
Amir Prince

Dear @Sirajeddine Bouasker
Thank you Sir, it worked as you told me.

2023-01-19 15-05-03
Sirajeddine Bouasker
2024-11-25 22-05-29
Sergio Aznar Guallar

Hi Amir,

That Notification.Id comes from the notification widget that you have in the screen. To find it, first you need to set a name to the notification widget to differenciate it from other notification widgets, then in the client action of the 'open' button, select the notification name that you want to open

Hope it help you


Kind regards,

Sergio

UserImage.jpg
Amir Prince

Hi @Sergio,

Unfortunately, it is not working.

  1. To obtain the Notification.Id, I added a name as you said, and got an id, but this is not working, I have got the following error message:


    Actually, I added a Notification Entity in the database , and in the CreateNotification Action, I am using the WidgetId (Notification.Id)
  2. I am following this documentation and they mentioned a parameter ShowNotification, where can I find it? (I tried to add my own but it is not working)
  3. They used it in the StartsOpen parameter, however in the console I have got the following warning:
    Thanks
2024-11-25 22-05-29
Sergio Aznar Guallar

Hi Amir, 

I really think you dont need an entity to handle all of this, since to show (or not) this widget its handled by the StartsOpen property. 

this parameter can be found at the properties of the notification widget, and here you just need to assign a boolean local variable, as it is mentioned in that documentation. After adjusting that the notification is showed (or not) at on entering in you page, you can then use the notification open and notifiacion close client actions to show the notification in the page.

Hope it help you


Kind regards,

Sergio

UserImage.jpg
Amir Prince

Thank you.
Unfortunately, in my case, I can't say if the notification should be shown (or not) at on entering to the screen, it depends on the number of Orders, if it is >5 I have to notify, else  the notification shouldn't be shown. 

2024-11-25 22-05-29
Sergio Aznar Guallar

you've probably already tried put that condition in the parameter, and it didnt work, right?

the condition could be like this:

If(EntityName.OrderNumber > 5, True, False)


Kind regards,

Sergio

2023-01-19 15-05-03
Sirajeddine Bouasker
Solution

Hi , 
I have used this many times, simply use a Client Variable: ShowNotif (boolean) and set it to true when your condition is true (for instance: GetOrders.Count >5) 
then in the StartsOpen field put: Client.ShowNotif.

It should be enough to get it working.
On the other hand, as Sergio has said, you don't need to add an Entity Notification (it depends on your usecase, it might be useful, but in general it is not mandatory)

Kind regards,
Sirajeddine

UserImage.jpg
Amir Prince

Dear @Sirajeddine Bouasker
Thank you Sir, it worked as you told me.

2023-01-19 15-05-03
Sirajeddine Bouasker
UserImage.jpg
Merabet Najat

hello guys i am new at using outsystems i didn t know where can get this 

could any one please help me?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.