How to generate separate notifications (in statusbar) by the

Post your questions and help other users.

Moderator: Martin

Post Reply
akhileshg1988
Posts: 109
Joined: 16 Apr 2014 04:57

How to generate separate notifications (in statusbar) by the

Post by akhileshg1988 » 22 Jun 2017 13:56

Hey there!
Need some help.
I have a call recording flow wherein after a call (either incoming or outgoing) is disconnected, the flow shows a notification on status bar asking whether I'd like to save this conversation? On selecting yes, it does nothing and on selecting no, it deletes the recorded call's file.
Now, the problem is that if I leave the notification as such (without pressing either yes or no) and in the meantime, another call is recorded by the flow, upon disconnecting this new call, the flow generates a new notification on statusbar and overwrites the old one (already existing) notification.
How can I set the flow to generate a separate new notification if a previous notification (generated by the same flow) already exists in the statusbar?

Kindly guide.
Thanks
Akhilesh Chandra Gairola

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: How to generate separate notifications (in statusbar) by

Post by Martin » 22 Jun 2017 19:51

Hi,

You have to use the notification ID field to use a different ID for the notifications.
For example you could create a global variable global_notification_id and assign the number 100. Use a script like this to increment the value for each call by one but reset to 100 when the 10th call is received so you are not flooded with notifications:

Code: Select all

global_notification_id = global_notification_id + 1;
if (global_notification_id==110)
{
  global_notification_id = 100;
}
In action Notification on Statusbar set field Notification ID to {global_notification_id}

Regards,
Martin

akhileshg1988
Posts: 109
Joined: 16 Apr 2014 04:57

Re: How to generate separate notifications (in statusbar) by

Post by akhileshg1988 » 30 Jun 2017 06:13

Hey Martin!
Thanks for your reply. I found a far better way (in my opinion) to implement what I had asked for.
Instead of using a global variable in the notification id field and incrementing it by 1 each time a new call gets recorded (as you had suggested), I have set the notification id field to the variable {triggertime,dateformat,ssS}. Since this variable is always gonna be unique each time the flow gets triggered, it completely solves my problem i.e. it always posts a new notification in statusbar when another notification already exists.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: How to generate separate notifications (in statusbar) by

Post by Martin » 30 Jun 2017 18:46

Nice, that's an interesting way to solve it, I especially like it because it does not require the global variable. Thanks for sharing!
The generated number is not guaranteed to be unique so one notification could overwrite another, but it's probably not that likely to happen.

akhileshg1988
Posts: 109
Joined: 16 Apr 2014 04:57

Re: How to generate separate notifications (in statusbar) by

Post by akhileshg1988 » 02 Jul 2017 08:18

Martin wrote:I especially like it because it does not require the global variable.
Same here. Me too.
Martin wrote:The generated number is not guaranteed to be unique so one notification could overwrite another, but it's probably not that likely to happen.
In my honest opinion, the chances of the generated number not being unique are rarest of the rare. What say?

Thanks
AKHILESH CHANDRA GAIROLA

Post Reply