- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 01:27 PM
I have a need to create a Wait Condition in a workflow that would trigger an Activity on a date. Business case, we have a user out of the country and will be returning on the 15th of July. On the 15th of July a returning activity would be generated.
Solved! Go to Solution.
- Labels:
-
Service Desk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 07:43 AM
I was able to resolve this issue using a Timer with the following script
// Set 'answer' to the number of seconds this timer should wait
answer = gs.dateDiff(gs.nowDateTime(), current.variables.scheduled_return_date, true);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 02:04 PM
Hello @John H1,
You can use the wait for condition activity to create a workflow that would trigger an activity on a date. For example, you can create a workflow that would generate a returning activity for a user who is out of the country and will be returning on the 15th of July. To do this, you can follow these steps:
- Navigate to Workflow > Workflow Editor.
- Click New to create a new workflow.
- Enter a name and description for the workflow.
- Select the table that the workflow applies to, such as User.
- Click Submit to save the workflow.
- Drag and drop the Wait for Condition activity from the palette to the canvas.
- Double-click on the activity to open its properties.
- In the Condition field, enter the condition that you want to wait for, such as [sys_updated_on] [on] [2023-07-15]. This means that the workflow will wait until the user record is updated on the 15th of July.
- Click Submit to save the activity.
- Drag and drop another activity from the palette to the canvas, such as Notification or Script.
- Double-click on the activity to open its properties.
- Configure the properties of the activity according to your needs, such as selecting a notification template or writing a script that generates a returning activity for the user.
- Click Submit to save the activity.
- Connect the wait for condition activity to the next activity with an arrow.
- Save and publish the workflow.
You can also use other methods to trigger an activity on a date, such as using a timer activity or a scheduled job. However, using a wait for condition activity may be simpler and more flexible for your use case.
I hope this helps.
Kind Regards,
Swarnadeep Nandy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 09:57 AM
This is very close to what I was thinking, We have a variable "Scheduled Return Date" that is the "Condition: variable. How can I get ServiceNow to trigger on that date?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 05:54 AM
The return date would be a variable "Scheduled Return Date". How can I use that in the solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 07:43 AM
I was able to resolve this issue using a Timer with the following script
// Set 'answer' to the number of seconds this timer should wait
answer = gs.dateDiff(gs.nowDateTime(), current.variables.scheduled_return_date, true);