- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2022 03:23 AM
Hello everyone,
We created a timer in workflow for generating reminder emails on daily basis.
But now, we want to trigger a reminder email via Workflow, only on business days, i.e. from Monday to Friday.
For that, we added a 'Wait-for-condition' in workflow, refer the screenshot attached.
We checked the script used here in the background script as well, and it was working fine, with proper result.
But when used in workflow, even on weekdays, the flow continues through wait-for-condition(returns true) till the end of workflow, hence generating a reminder email on Saturdays and Sundays as well, which is not expected.
Please let us know your thoughts.
Thank You.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2022 04:39 AM
Use this script in the condition script box:
(function() {
//run on weekdays only
var day = new Date().getDay();
return (day != 6 && day != 7);
})();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2022 03:42 AM
Hi,
Can you include a schedule in your if condition using GlideSchedule?
or
Could you switch to Flow Designer and use a schedule within a wait condition?
Kev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2022 04:39 AM
Use this script in the condition script box:
(function() {
//run on weekdays only
var day = new Date().getDay();
return (day != 6 && day != 7);
})();