User Review
( votes)Introduction
Whenever we work with Dynamics 365 CRM using Power Automate (Microsoft Flow), there might be scenario where we want to trigger the flow on multiple events like create of record, update or delete of record. So, Microsoft has come up with connector in Power Automate where we will get a combination of multiple events in a single trigger. With this we can trigger our flow to execute different tasks. When we use this trigger it might be such that what we need to achieve depends upon the events on which the flow gets triggered.
In this blog we will see how to get the trigger type and perform further tasks depending upon the triggered event. For example, I have created a flow to perform some task in Dynamics 365 CRM using common data service (current environment) connector in which we will get the combination of multiple events in trigger as shown below:
Suppose I want a notification whenever the Account entity record is created or updated in CRM. Hence, I selected the trigger condition as below:
Next, to get the trigger event we can use the ‘SdkMessage’ property which we get when the flow step is executed in the output as shown below:
I will now add the condition triggerOutputs()?[‘body/SdkMessage’] operator as ‘is equal to’ and value as ‘Create’.
Now if the ‘Create’ event is triggered then I will be able to perform further task like send a notification for the same. For this, I have added notification connector to get the email notification of the same as below and saved the flow.
Conclusion
In this way, with common data service (current environment) connector in Power Automate we can trigger the flow to perform multiple events by using single trigger condition.
If your flow designer experience does not list out dynamic values as shown in the screenshots above, make sure to enable the new Experimental features for Power Automate.