Trigger a task on a specific date (workflow)

Nawal
Mega Guru

Hello, 

I have to create this workflow, and the task Retrieve Hardware must be triggered on the date mentioned in item .

find_real_file.png

 

find_real_file.png

any idea how to do this?

Thank you 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Nawal 

From what I could get from your question

1) You want Catalog Task to be created on that date

Example: If date is 10th Jan 2021 so catalog task should be created on that day and your workflow should wait till that time

If yes then you can use Workflow Wait for Timer Activity with Script below

var gdt = new GlideDateTime(current.variables.Scheduled_retrieve_date);

answer = gs.dateDiff(new GlideDateTime(), gdt, true);

find_real_file.png

Regards
Ankur

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

View solution in original post

14 REPLIES 14

Hi Dirk, 

I tried this :

but still not working

find_real_file.png

 

 

 find_real_file.png

find_real_file.png

find_real_file.png

 

the variable is : 

find_real_file.png

Ankur Bawiskar
Tera Patron
Tera Patron

@Nawal 

From what I could get from your question

1) You want Catalog Task to be created on that date

Example: If date is 10th Jan 2021 so catalog task should be created on that day and your workflow should wait till that time

If yes then you can use Workflow Wait for Timer Activity with Script below

var gdt = new GlideDateTime(current.variables.Scheduled_retrieve_date);

answer = gs.dateDiff(new GlideDateTime(), gdt, true);

find_real_file.png

Regards
Ankur

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

Hi Ankur, 

Thank you your help.

Yes it is exactly what should be happen.

I tried this but still  not working.

find_real_file.png

 

find_real_file.png

 

 

 

 

Hi,

what date have you selected?

Today is 5th Jan

If you have selected date as 6th/7th Jan then you should check whether catalog task got created on 6th or 7th

Workflow will wait till that date and then it would proceed

Regards
Ankur

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

 

i tested with 2 minutes interval

find_real_file.png

find_real_file.png