Auto case creation on first saturday of evry month

sudhakar kondap
Tera Contributor

 i have details to be mapped , I am facing difficulty in triggering the flow , I want to trigger a flow which will create an case automatically on first Saturday of every month, can anyone guide me if not flow any other approach ?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@sudhakar kondap 

2 approaches

1 ) You can use daily scheduled job which checks if today is 1st saturday or not, use this in Condition field and set answer=true/false.

if answer=true then script of scheduled job will run

somewhat challenging using flow as you can't directly determine the 1st saturday of every month.

OR

2) You can use a daily scheduled flow and call a custom flow action which checks if it's 1st Saturday and returns true/false

If true then your flow proceeds

If false the flow ends

Something like this to check if today is 1st saturday of month

// Only run on the first Saturday of the month
var today = new GlideDateTime();
var dayOfMonth = parseInt(today.getDayOfMonthLocalTime(), 10);
if (dayOfMonth <= 7) {
    answer = true;
}
answer = false;

AnkurBawiskar_0-1752215329725.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

2 REPLIES 2

Shubham_Jain
Mega Sage

@sudhakar kondap You can make use of Scheduled Job Script Execution. This will help you to define the frequency. 

✔️ If this solves your issue, please mark it as Correct.


✔️ If you found it helpful, please mark it as Helpful.



Shubham Jain


Ankur Bawiskar
Tera Patron
Tera Patron

@sudhakar kondap 

2 approaches

1 ) You can use daily scheduled job which checks if today is 1st saturday or not, use this in Condition field and set answer=true/false.

if answer=true then script of scheduled job will run

somewhat challenging using flow as you can't directly determine the 1st saturday of every month.

OR

2) You can use a daily scheduled flow and call a custom flow action which checks if it's 1st Saturday and returns true/false

If true then your flow proceeds

If false the flow ends

Something like this to check if today is 1st saturday of month

// Only run on the first Saturday of the month
var today = new GlideDateTime();
var dayOfMonth = parseInt(today.getDayOfMonthLocalTime(), 10);
if (dayOfMonth <= 7) {
    answer = true;
}
answer = false;

AnkurBawiskar_0-1752215329725.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader