• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Blog
  • Power Platform
    • Power Apps
    • Power Automate
    • Power BI
    • Power Virtual Agents
  • Dynamics 365
  • Azure
  • About Me
Joe Gill Logo

Joe Gill

Microsoft MVP - Power Platform Consultant

Determine which Dataverse event triggered a Flow in Power Automate

9th September 2020 by Joe Gill

Using the Common Data Service (Current Environment) connector you can create Power Automate flows that get triggered by an event on a Dataverse table. In this post, we will go through how to identify the Dataverse event that triggered the flow.

Step 1. Create The Flow

When you create the flow you choose a condition or set of conditions that trigger the flow.

Determine which Dataverse event triggered a Flow in Power Automate - Joe Gill

Step 2. What Flow does based on the Dataverse trigger

Sometimes you need to vary what the flow does based on the Dataverse trigger that started the flow. There is no obvious way to test which condition triggered the flow. Because of this, I have seen situations on projects where there are lots near-identical flows for create and update. This can obviously lead to maintenance issues. You can however create an expression to examine the SdkMessage attribute in the trigger body of the flow. The SdkMessage contains the name of the event that triggered the flow.

Determine which Dataverse event triggered a Flow in Power Automate - Joe Gill

Step 3. Using Expression

You can use the expression in a number of ways such as testing its value as part of a switch or condition control.

Determine which Dataverse event triggered a Flow in Power Automate - Joe Gill

Step 4. SdkMessage

You can use SdkMessage in an expression to conditionally set the value of a field based on it’s value e.g. if(equals(triggerBody()?[‘SdkMessage’],’Update’), ‘Updated’, ‘Created’)

Determine which Dataverse event triggered a Flow in Power Automate - Joe Gill

Step 5. Testing Value of SdkMessage

If you are testing the value of SdkMessage a number of times in your flow you might be better to create a variable at the start of your flow and use this instead. This will make your flow more readable.

Determine which Dataverse event triggered a Flow in Power Automate - Joe Gill
Share This On Social:
  • Tweet
  • Determine which Dataverse event triggered a Flow in Power Automate - Joe Gill

Filed Under: Power Automate, Power Platform

Primary Sidebar

More to See

Power Platform Requests – Base Request Capacity

17th December 2020 By Joe Gill

Power Automate Desktop

Power Automate Desktop – UI Flow

26th November 2020 By Joe Gill

Synapse Link for Dataverse Security

16th December 2022 By Joe Gill

Power Fx -Power Virtual Agents

28th November 2022 By Joe Gill

Footer

Joe Gill

Microsoft Business Applications MVP – Power Platform, Dynamics 365 and Azure.

An architect with over twenty years experience designing and developing technology solutions. Specializing in the Microsoft technology stack including Power Platform, Dynamics 365 and Azure. Microsoft MVP Profile

Connect on Social

Useful Links

  • Home
  • Blog
  • About Joe Gill
  • Power Platform
  • Dynamics 365
  • Azure

Featured Posts

Power Platform Requests – Base Request Capacity

Power Automate Desktop – UI Flow

Synapse – SQL Admin

Synapse Link for Dataverse Security

Power Fx -Power Virtual Agents

Synapse Link for Dataverse – Append-Only

© 2023 ยท Joe Gill