How can I check if a field has changed in the middle of a timer in a flow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 08:53 AM
I need some assistance if someone would not mind. I'm going to describe what I have with a flow
I have a flow that is a trigger that looks at the service request form (particular to our instance) to see if the State = "Waiting - Client" and the assignment group is (1 of two groups). There are two business rules that will either turn on or turn off a check box called Nudge.
I have the trigger on the flow set to run trigger : Only if not currently running.
My scenario:
The trigger is started when a Service Request State is set to Waiting - Client. Then after the flow starts there is a 168 hr timer. If the Nudge checkbox is still true, then send an email after the 168hrs have expired. However, here is the question or puzzle I just thought of.
So let's say the timer is at 150hrs. Client Responds and Nudge Unchecks at 151hrs. We respond and set the state back to Waiting-Client at 155hr. Then according to what I'm seeing no, the flow, the original timer is still running, and the flow will send an email to the client at hr 168.
I think that there should be a check to see if the state has changed during the initial timer then, it would not send an email and start the timer all over.
So my question is, how can I check or restart the timer if there was a change to the state and if it went to Message Received, then restart the timer? I currently have the timer at 4 minutes to test.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 02:05 PM
Hello Stephen,
I believe that this will be a bit tricky because you will need to evaluate whether the field "Nudge" has been updated - as per my understanding it can be set to true and false several times within the 168hr.
So what I would suggest is:
- create a metric on the field to store each change - this is to use OOTB functionality and avoid creating a new field
- in the flow first activity after trigger count how many metric instances are for the definition from point 1 - store in a flow variable
- after the wait for duration, activity recount the number of metric instances for the definition - store in a flow variable
- if values are equal send the email, otherwise don't trigger the event - I'm presuming that you're using events.
Hope this helps!
Tudor