
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2023 04:57 PM
I need to have a flow that triggers the first Friday of every quarter. What is the best day to do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2023 05:30 PM
Hi Brian,
Unfortunately, this is not yet possible, however you can create a subflow and then trigger it via scheduled job.
Please see KB0961745 for reference.
You would run the scheduled job weekly on a Friday and check if its the first month of the quarter and then since a Friday should occur in First 7 days it should only come true once in that month.
Your script condition should be something like this but please test it in non-prod
var answer = false;
var now = new GlideDateTime();
var month = now.getMonth();
var day = now.getDayOfMonth();
if ((month == 1 || month == 4 || month == 7 || month == 10) && day <= 7) {
answer = true;
}
answer;
Hope this helps
Thanks
Anks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2025 11:22 PM
Hi Brian,
I have got similar requirement to create a task on 1st day of every quarter
Solution:
I have created a custom action with below fields and script
fields:-
Input - input_date (date/time)
Output - monthNumber (integer)
script:-
// Extract the month number (0-based in GlideDateTime, so add 1)
Later I have used if condition to check the month number =1,4,7,10
Regards
Reddy Surendra