Email Reminder (Flow

Dizy M
Tera Expert

Hi!

I have this flow designer and it sends email reminder to a user.

 

The prob is it seems that the flow designer is not getting the other records output value.

 

I've set a condition here that "If send date is 2" (2 means -  email send date is 2 DAYS apart from today's date.)

So it shows here in the 1st record that the email send date is 4 days apart from today's date .

 

DizyM_0-1701237230767.png

 

 

 

 

However on the 2nd record and the other records, it shows the same "4" (All of the records have different dates on when the email was sent so its impossible to be 4 days apart from today's date)

DizyM_1-1701237231703.png

 

 

 

Here's the script for my flow variable "send date":

 

var gr = new GlideRecord('custom_table');
gr.addEncodedQuery('u_sent=true^u_notification=test');
gr.query();

while (gr.next()) {
var send = gr.u_send_date
var dateField = new GlideDateTime(send);
var nowTime = new GlideDateTime();
var dur = new GlideDuration();
dur = GlideDateTime.subtract(dateField, nowTime);
var days = dur.getDayPart();
return days;
}

 

 I'd appreciate any help . Thank you so much

0 REPLIES 0