Wait For Field to be updated (Workflow)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2017 11:58 AM
Hello, I' am trying to determine what would be the best approach to use when determining if something has changed on the record for the workflow to reroute..
My scenario is an hr app that when we use referrals if the hire date has to be pushed off, we want to use a roll back option to start it over.
I was looking at using a wait for condition that triggers if that field is updated, but I"m not having much luck using the dropdown conditions.
Any ideas out there?
Derek
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2017 12:24 PM
Hi Derek,
Use the If Activity before the rollback activity and remove the wait for condition activity.
create new field on the form like .. Push the hire date and answer is yes or No.
now In workflow use IF condition and write something like if(current.variables.pushhiredate == 'Yes')
{
return false
}
else
{
true;
}
Now attach the if statement to rollback activity. when if condition fails then it will move back to previous stage.
Thankyou.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2017 12:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2017 03:22 AM
Hello Derek,
Wait for condition will be perfect only for some cases where it should wait for more tasks to get generated based upon the time & condition.
So my suggestion is
In IF activity itself try writing the condition something like this, as shown in below code.
if current date will be greater than the Hire date, then condition will be false and it will go to rollback activity.
if(gs.now() > current.hire_date)
{
return false;
}
else
{
return true;
}
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2017 03:35 AM
Hi Derek,
In ServiceNow, you can wait by using 2 ways, Wait for Condition OR Timer activity. If your requirement is to wait till the current record meets some condition, you should opt for Wait for Condition activity. Or if your requirement is to wait for few mins or days, you can use Timer activity, that will wait irrespective of any field value of the current record.
If you can elaborate your requirement with proper screenshot(s), it will be easy for us to provide you any solution. Sorry, the attachment shared by you earlier is not visible to me.
I hope this helps.Please mark correct/helpful based on impact