Thursday, 11 October 2018

Triggering a Flow when Dynamics 365 fields have changed

21:42 Posted by Elaiza Benitez , , , , No comments
When you configure a Dynamics 365 workflow to be triggered on update of a record, it is defined by fields that have changed.

How do I replicate this in Flow?

Welcome to another WTF blog post where I share with you on how to replicate this in Flow.

Can I do this using a Dynamics 365 trigger?

The answer is no. Not what you wanted to hear right?

When you use the Dynamics 365 trigger of "When a record is updated" or "When a record is created or Updated" the Flow will always execute because you are unable to define the fields that the Flow needs to validate as a result of an update in Dynamics 365. There's two reasons why this is not ideal.

Reason one

If you have other Flows that are executing for the same entity where you have selected the "When a record is updated" trigger, all your other Flows will execute. If there is a Flow that is updating a field whenever an update has occurred for the record, you'll experience the Flows to continuously execute.

I experienced this when I was experimenting with what I could do with Flow in the beginning for my Dynamics 365 Saturday New Zealand presentation. I had a few Flows executing for the same entity whenever the record is updated and one of them ended up being continuously triggered.

Reason two

If you have a large volume of Flows that will execute in a month and you are on the free plan of Flow, i'ts possible that you may reach that limit. You don't want to burn through your threshold.

Oh dear. What can I do then in Flow?

If you have a Flow Plan 1 or Flow Plan 2, you are entitled to use Premium connectors. A Premium connector that is available to use is the Common Data Services connectors. I showed you this in WTF Episode 1.

When you select the "When a record is updated" CDS trigger, you'll see Show advanced options. When you click on this, the step will expand where you can select your field(s) to define when the Flow is executed.

Does it work?

Yes as seen in my vlog. If you update any other field that is not defined in the trigger step of Flow, the Flow will not execute. The moment you do update a field that is defined in the trigger step of the Flow, the Flow will execute. This means the number of Flows executed whenever a record is updated will be low in comparison to when a Dynamics 365 trigger is used.

Summary

If you want to replicate the same functionality that you are used to in Dynamics 365 workflows where it will only start when fields have been updated, you must have a Flow Plan 1 or Flow Plan 2 licence to use the CDS connector. In the "When a record is updated" CDS trigger, you can define the fields through advanced options.

If you don't have a Flow Plan 1 or Flow Plan 2, you will need to create some additional fields to prevent other Flows that reference the same entity to continue to execute. However the Flow will still execute whenever an update has been made to the record.

Another #FlowFever blogger to follow

Thanura, aka T or Thunder ⚡ has a blog post that provides a side by side comparison of Dynamics 365 connectors and CDS connectors. I recommend you check it out as it's a great blog post that will help you understand the limitations.

T blogs about Flow in the context of Dynamics 365 in our community, follow him.

Till next time, toodles!

0 comments:

Post a Comment