filter records that has due date 4 days from now

Simran321
Tera Expert

I have created the flow using flow designer that triggers everyday and look up for approvals that have not been approved. I want to add additional condition that due date for the approval should be with 3 days or 4 days. Basically, want to filter out the items that have not been approved 3 - 4 days before the due date.

The filter I am adding is

approval for.due date relative on 4 Days from now. 

If I use filter relative on or before 4 days from now then it pulls the expected record.

What am I doing wrong?

5 REPLIES 5

Mike Patel
Tera Sage

You can run scheduled job daily with something like

var Days = gs.daysAgoStart(-4).split(' ');

var gr = new GlideRecord('sysapproval_approver');
gr.addEncodedQuery('state=requested');
gr.addQuery('sysapproval.due_date', 'CONTAINS', Days[0]);
gr.query();
while (gr.next()) {
    gr.comments = 'Reminder';
    gr.update();
}

Hey Mike,

I am doing this in flow designer. I am using look up records from approval table that is in requested state. Can this be done without scripting?

Thanks,

Madhu

Then you can do something like below

find_real_file.png

find_real_file.png

I think script will be the best option since using relative will give you all the record after the 4 days. If due date is 10 days after then it will show up in query.