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

Thanks for the insight all,



Basically I have a date field that if it changes I need to roll back and restart the other timers in the workflow.



So if they change the date, I need to rollback and restart the timers. I am having issue trying to set up the wait for condition to do this. I could use an event, but I think that is overkill.



(I was trying to see if I could use conditions instead of scripting out but I don't think this would work.






Workflow:



Hi Derek,



Please have a look at this wiki link (section 4.4) Condition Activities - ServiceNow Wiki. This will give you the idea to implement the same. Also similar discussion was taken place in the below threads too. Encourage you to have a look:


1.Issue with Script in Wait for Condition  


2.   Wait for condition change requests



As of now the first thing which is coming in my mind is a workaround.Although this is not the proper solution, but you can achieve your requirement by using this. All you need to create a new 'Choice' type field, which will not be visible on the form, having 2 choices as 'Yes' and 'No'. Make the default value of the field is 'Yes'. Now all you have to do is to write one after update Business Rule on the Requested Item (sc_req_item) table as of below:


if(current.start_date_field_name.changes()){


current.new_field_name = 'No'; //pass the choice type field name


current.update();


}


Once you are done with the above configuration, set the Wait for Condition in your workflow as Field is No. That means initially the Field value is set as 'yes', as that is the default value. The Workflow will stuck at Wait for Condition. When anyone changes the Start Date field, the Field value is changed to 'No and the Wiat for Condition meets its value and the flow progress.



I hope this helps.Please mark correct/helpful based on impact



Hi derek.yager@virteva.com ,



Were you able to have a look at my response?


If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.


If you are viewing this from the community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View