- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 01:24 PM
We have a requirement to run a flow every 2 months on the first of that month. I could set the flow to repeat every 60 days, but over time the execution would float away from the first of the month.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 04:06 PM
I'm going to assume by every two months you mean if the current month is evenly divisible by two. In other words that your interval is not every two months starting from date X.
Set your flow to run Daily at midnight.
Create two flow variables, month_is_even and day_is_1.
Use the Set Flow Variables flow logic to set their values as follows
var gdt = new GlideDateTime();
return gdt.getMonthLocalTime() % 2 == 0 ? true : false;
var gdt = new GlideDateTime();
return gdt.getDayOfMonthLocalTime() == 1 ? true : false;
Use an If-block to run your flow logic if both variables are true.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 04:06 PM
I'm going to assume by every two months you mean if the current month is evenly divisible by two. In other words that your interval is not every two months starting from date X.
Set your flow to run Daily at midnight.
Create two flow variables, month_is_even and day_is_1.
Use the Set Flow Variables flow logic to set their values as follows
var gdt = new GlideDateTime();
return gdt.getMonthLocalTime() % 2 == 0 ? true : false;
var gdt = new GlideDateTime();
return gdt.getDayOfMonthLocalTime() == 1 ? true : false;
Use an If-block to run your flow logic if both variables are true.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 07:50 PM
Hi
the easiest solution is to use a scheduled script, convert the Flow to a Subflow and execute that Subflow via API
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 07:56 AM
Yes, set it to run Monthly on day 1, and use the Condition field to check what month it is.