
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2018 05:23 AM
I want to know if it is possible to generate a task based on the date of a variable. If this is not feasible or there are many risks, could someone offer a solution based on this need.
So I have a catalog item that has a variable that is a date field. The way that I want this workflow to work is:
a. Customer submits the form,
b. All approvals go through,
c. An email goes to the customer letting them know that the access has been granted.
d. Once all tasks have been completed, I want the workflow to stop & wait but not close the RITM because the variable that is a date field I want a task to generate when that date has been reached.
Any assistance would be much appreciated.
Thank you,
Karen
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2018 06:38 AM
You can do something like below. add timer after wait for task timer
Timer
Name: Wait for End date
Time based on: Script
Script:
var endDate = current.variables.end.getDisplayValue();
answer = gs.dateDiff(gs.nowDateTime(), endDate, true);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2022 01:32 AM
gs.datediff is not working in timer activity
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2023 09:43 PM
Hi @Mike Patel ,
I have a similar kind of requirement but first task need to generate one day before the start date which is working and the second task need to generate after the one day of the end date variable value.
Could you please suggest me in this one
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2023 07:54 AM
You can add timer right before 1st task with like below script
var gdt = new GlideDateTime(current.variables.start_date); //replace this field with your field name
gdt.addDays(-1);
answer = gs.dateDiff(gs.nowDateTime(), gdt, true);
then add timer after 1st task for 2nd task like below
var gdt = new GlideDateTime(current.variables.end_date); //replace this field with your field name
gdt.addDays(1);
answer = gs.dateDiff(gs.nowDateTime(), gdt, true);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2018 06:57 AM
Yes, this can be done with a Timer activity in the workflow.
In the of variables, you will need to set the timer based on a script. Just calculate the number of seconds to wait. You can do this with the gs.dateDiff() function to determine how many seconds between now and the date you have in the variable.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2018 07:17 AM
Thanks Chuck,
I am just gathering information at this point. I'm waiting for the customer to get back to me with final requirements.
This is much appreciated.
Have a great weekend.
Karen