How to send a WF notification with only one exact field change?

We already know how to set up a workflow to send notification via email about an updated/deleted/changed record. But what if we want to send an email if, for example, we only change the STATE field?

Firstly, in the workflow you cannot use methods such as change item / currently change. Workflow doesn’t notice this method.

Second, you must use JS with the field specification:


if(doo.model.<[State (state)]>.value === doo.model.<[State (state)]>.originalValue){
doo.workflow.stop();
}

This JS compares the old and new value of the STATE field. WF will stop if the value is the same and send a notification email if the value has changed.

That’s all you need. Simple and easy. Let me know if you appreciated this advice in the comments below the article :blush:!

With kind regards,

Soňa

2 Likes