Skip to main content

How can I update a variable once it has been set in a running workflow?

Here is my scenario. Once the Hearing Date is set on the list item, I calculate the days, store it in a workflow variable, pause until that calculated date and send an email.  But what if someone comes in a changes the date on the list item? Is it is possible to reset that variable/date calculation?

208943_pastedImage_1.png

could you have a workflow on the list that runs only when hearing date is changed that terminates and restarts the above workflow?


Unfortunatley there are other steps in the workflow, before and after the snippet I'm showing, that I wouldn't want to re-run. I suppose I could cut this portion out and run it as a separate workflow, however my preference is to do it all in one if the software is capable of that.


In that case I would take this reminder part out and use a scheduled site workflow to run every day that checks for dates in the next xxx days. I have written a blog post on something similar - see if you think it could fit your requirement?


You could possibly add a loop that compares the current hearing date to the stored date (store the hearing date in a variable) and triggers a subsequent revisit of the reminder logic if the date has changed. Build in a wait on the loop for whatever period you which to poll the value for. If the change is detected it then performs the calculations again.


Thank you for the tip. I tried this out and it is working great.


Reply