Wait For Field to be updated (Workflow)

Derek10
Tera Expert

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

7 REPLIES 7

harishdasari
Tera Guru

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.


Hey Harish,



This is for a date field, in case the date field changes, so I can't use a false. Any thoughts?


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.


amlanpal
Kilo Sage

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