Using Follow Up field in task or incident table to send notification

Roshni1
Tera Expert

We are using the OOTB "Follow Up" field on our SN instance. 

I have a requirement that when the Follow Up field is set with a date the agent will be following up on either a task or incident that an email is sent on the "Follow up" date is met.  

The email notification to be sent to the "assigned to" 

 

Looking for assistance on how to either set a BR or Flow and which would work best. 

 

Thanks in advance

 

1 ACCEPTED SOLUTION

Hello @Roshni1 ,

 

What is the type of the "Follow up" field in your instance?

OOTB it is a Date/Time field. 

 

RobertH_0-1749882810798.png

 

Did you change the type? From your screen shots it looks almost like a plain text field.

Is the date picker opening when you click on the field in the condition builder?

 

RobertH_1-1749882891056.png

 

Regards,

Robert

 

View solution in original post

7 REPLIES 7

Manikandan1
Tera Expert

You can achieve this either through Flow Designer or a Scheduled Script Job, but based on your use case, I'd recommend using a Scheduled Job.

  • It checks for records where the Follow up date is today.
  • It sends an email notification to the assigned_to user when the date is met.

Thanks for your recommendation are you able to provide an example of how to do this in scheduled jobs? 

Robert H
Mega Sage

Hello @Roshni1 ,

 

Here is a very basic example of what you need to put into your daily Scheduled Script:

 

function sendEmail(gr) {
    var email = new GlideEmailOutbound();
    email.setSubject('Please follow up on ' + gr.getValue('number'));
    email.setBody('The follow up date is today.');
    email.addRecipient(gr.assigned_to.email.toString());
    email.save();
}

var gr = new GlideRecord('incident');
gr.addQuery('follow_up', '>=', gs.beginningOfToday());
gr.addQuery('follow_up', '<=', gs.endOfToday());
gr.addQuery('active', true);
gr.query();
while (gr.next()) {
    sendEmail(gr);
}

 

In reality you probably would define an Event Registration and a Notification record for maintaining the content, and then trigger the event from the above script.

 

Or, if you don't want to script you can create a Flow, like this:

 

RobertH_0-1748062859036.png

 

Notification configuration:

 

RobertH_1-1748062925126.png

 

Regards,

Robert

Hi Robert, 

Thanks very much for the assistance, I went the route of configuring a flow and have added this flow but its not working. 

 

I am not sure if its cause I have "Follow up is Today" and not the same as your. 

Would you be able to review the flow and advise .