Identify the trigger message when using Common Data Service (Current) Connector in Power Automate Flows

Sending
User Review
0 (0 votes)

The earlier versions of the D365 Connector or the Common Data Service connector provided separate triggers for each of the CRUD actions like Create, Update and Delete. The latest version of the connector Common Data Service (Current) which is the one we should be using moving forward in most cases provides a single trigger as can be seen in the screenshot below

Power Automate

Once you choose this trigger, you are then allowed to choose from the various combinations of trigger conditions supported

Power Automate

This was a good improvement over the previous versions of the connectors because quite often we have similar logic to be executed upon Create or Update and now with the ability to combine these two trigger conditions, we can have a single flow designed to cover both the scenarios.

In one of the projects we came across a scenario where in addition to the common logic to be executed for both Create and Update operation, there was one piece of logic specific to Update action.

And there came the need to be able to identify the action that invoked the flow “Create” or “Update”.

While the dynamic values listing does not provide this information directly, looking at the output body from the test execution, we found that it does share this information

Power Automate

To use this value, choose to add expression (click on fx button) to bring up the below screen

Power Automate

Choose the first dynamic value listed as part of your operation output – Account Name in my case

Power Automate

Now replace “name” in the above with “SdkMessage” and your expression should now look like

Add the message names as the cases for Switch operation

Note: 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

Navigate to Setting -> View all Power Automate Settings to bring up the following screen

Conclusion

Have a look at the payload that is returned as part of the trigger output – you might find values being returned that have not been exposed as Dynamic Values but could still be used by defining appropriate expressions for them.