Create custom time-based triggers for Flow Designer - every 2nd Tuesday of the Month
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 08:47 AM
Hello all
Happy New Years.
i have a requirement to create a custom time base trigger for Flow designer
what i need to do is:
1) have the trigger run every 2nd Tuesday of the month
2) have another trigger to run every 2nd Tuesday of a specific month ( ex. 2nd Tuesday of Jan. or 2nd Tuesday of Oct.)
i know that i can set the trigger to run daily but how do i calculate to for the other items above
any and all help is appricated

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 09:55 AM
I think you need an if script to identify if today's date is Tuesday and today's date is greater than 7. You can get Day of the week using getDayOfWeekLocalTime() function.
That will help you with the 1st use case.
For the 2nd use case use the logic of the first and then use getMonthLocalTime to get the month. Below link should help you with these functions.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 10:21 AM
i am still confused on how to incorporate that into the flow designer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 12:02 PM
So your trigger condition should be a Scheduler triggering every Tuesday
Then you need a Flow action to identify, if it is 2nd Tuesday. You can get the logic from below thread
The result of the above action, you can validate using an If Flow logic in the Flow and then proceed with the job you want to perform.
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 10:28 AM - edited 01-08-2024 10:31 AM
Please check this KB Article
To calculate the Month & day of week, can think of using these methods
var now = new GlideDateTime();
var month = now.getMonth();
var day = now.getDayOfMonth();
Or
You can think of utilizing eventQueueScheduled & a script action combination
Thanks,
Narsing