filter records that has due date 4 days from now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2020 05:48 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2020 05:55 PM
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();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2020 06:02 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2020 06:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2020 06:13 PM
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.
