I’m sure that from my previous blog post on Power Pipelines, you’re familiar with how Power Pipelines can turn solution deployments from a hassle to a breeze. However, one lesser-known fact about Power Pipelines is its compatibility with Power Automate’s “When an action is performed” trigger. In this post, I’m going to explain what the trigger is and how you can combine it with Power Pipelines to gain invaluable insight into your deployments.

screenshot of When an action is performed Dataverse trigger

What is the “When an action is performed” Dataverse trigger?

The “When an action is performed” Dataverse trigger is exactly what it sounds like – this trigger allows you to run flows when certain Dataverse actions are performed. The interesting part comes into play when we explore what those actions are. All of the actions performed on your data by Power Pipelines can be defined as Dataverse business events. This trigger allows you to run flows when these business events relating to your Pipelines are executed, which opens the door for a wide variety of Pipelines reporting options to give you and your business the most up-to-date information regarding your deployments. In this article, I’ll be discussing some of the more basic Dataverse business events that this trigger can execute on.

OnDeploymentStarted Dataverse Business Event

Using this business event, a Power Automate flow can be triggered when a deployment is started using Pipelines. This deployment can either be starting “now” or be scheduled to start later. Let’s take a look at the below Power Automate flow configuration to understand how reporting on this Dataverse business event can help businesses get the most out of Pipelines.

screenshot of Power Automate flow configuration

OnDeploymentStarted Dataverse Business Event

The flow we will be looking at for this Dataverse business event is extremely simple, as pictured.

screenshot of Power Automate flow configuration details

When an action is performed configuration details

To configure the “When an action is performed’ trigger to run from Pipeline events, use the following values:

                        Catalog: Microsoft Dataverse Common

                        Category: Power Platform Pipelines

                        Table name: (none)

The Action name refers to which Dataverse business event the flow should run from. In this example, I am using the OnDeploymentStarted business event to run my flow after the Pipelines user selects “Deploy” and initiates the deployment.

Adding Trigger Conditions to the “When an action is performed” Trigger

Power Pipelines trigger-4

Adding trigger conditions is a great way to get even more specific about when this flow will execute. There are 3 main examples I will be discussing.

1. Trigger the flow for one specific Pipeline

Example code: @equals(triggerOutputs()?[‘body/OutputParameters/DeploymentPipelineName’], ‘Pipelines Blog Deployment’)

This trigger condition specifies that I would like this flow to trigger when the “Pipelines Blog Deployment” Pipeline, and not any of my other Pipelines, is started.

2. Trigger the flow for one specific Pipeline Deployment Stage

Example code:

@equals(triggerOutputs()?[‘body/OutputParameters/DeploymentStageName’], ‘Deploy to UAT’)

This trigger condition specifies that I would like this flow to trigger when the “Deploy to UAT” Deployment Stage is started.

3. Trigger the flow for one or multiple specific Pipeline Deployment Stages

Example code:

@contains(triggerOutputs()?[‘body/OutputParameters/DeploymentStageName’], ‘UAT’)

This trigger condition specifies that I would like to trigger this flow when any Deployment Stage that contains “UAT” in its name is started.

Use the Built-In Dynamic Content to Construct Flow Logic and Deliver Valuable Information

When the “When an action is performed” trigger is used, dynamic content in the form of input parameters is available for use. I will be demonstrating how I use this dynamic content to build more logic into my flow and deliver the business valuable information about the Pipeline that I am reporting on.

screenshot of Condition card

Using a Condition card to implement custom business logic

In this example, I begin by using a Condition card to implement the following custom business logic:

  • If the Deployment Status is Scheduled, which means that the deployment is scheduled to start later, send a specific email.
  • If the Deployment Status is Started, which means that the deployment is starting now, send a specific email.

Note that “Started” and “Scheduled” have known Dataverse choice column values of 200000001 and 200000005 respectively.

Example Condition code: triggerOutputs()?[‘body/InputParameters/DeploymentStatus’] = 200000005

screenshot of If yes/no flow Send an email dialog boxes

Send an email action based on Deployment Status

screenshot of Deployment status: Started email sent by flow

Deployment status: Started email sent by flow

In the email actions, I am sending out one specific email if the deployment has started now vs. if the deployment is scheduled to start later. Some of the dynamic content parameters that I make use of are below:

Example code:

Artifact Name: : triggerOutputs()?[‘body/OutputParameters/ArtifactName’]

Pipeline Name: : triggerOutputs()?[‘body/OutputParameters/DeploymentPipelineName’]

Stage Name: : triggerOutputs()?[‘body/OutputParameters/DeploymentStageName’] Status: if(equals(triggerOutputs()?[‘body/InputParameters/DeploymentStatus’], 200000005), ‘Scheduled’, ‘Started’)

OnDeploymentCompleted Dataverse Business Event

Using this business event, a Power Automate flow can be triggered when a deployment is completed using Pipelines. We can gather information about the status of the deployment (e.g., Failed, Cancelled, Succeeded) and implement custom business logic based on it.

screenshot of OnDeploymentCompleted Dataverse Business Event

OnDeploymentCompleted Dataverse Business Event

Once again, our flow is very simple but can prove to be very insightful. This flow starts similarly but uses the OnDeploymentCompleted Dataverse business event.

screenshot of switch statement

Switch statement to determine Deployment Status value

The flow uses a switch statement to determine what the Deployment Status value is. Note that “Succeeded”, “Cancelled”, and “Failed” have known Dataverse choice column values of 200000002, 200000006, and 200000003, respectively.

            Example code: triggerOutputs()?[‘body/InputParameters/DeploymentStatus’]

screenshot of email actions based on deployment status

Email actions based on Deployment status

In the email actions, I am sending out one specific email if the deployment has succeeded, has been cancelled, or has failed. I use the same dynamic content values as in the OnDeploymentStarted flow to send the business helpful information regarding the Pipeline in question.

With the “When an action is performed” Dataverse Trigger and Power Pipelines, More Knowledge is More Power!

Don’t settle for less than real-time updates on your Power Pipelines – combine this powerful tool with the “When an action is performed” Dataverse trigger to maximize your reporting and conduct smooth, transparent deployments. Read our Power Pipelines Basics: Simplifying Solution Deployment post to get started with Pipelines.

Need a little help? Contact us today if you’d like to learn more about how to level up your Power Platform solutions!

Compass365, a Microsoft Gold Partner, delivers SharePoint, Microsoft Teams, and Power Platform solutions that help IT and Business leaders improve the way their organizations operate and how their employees work.

Subscribe

Join over 3,000 business and IT professionals who receive our monthly newsletter with the latest Microsoft 365 tips, news, and updates.

We do not share or sell your information and you can unsubscribe at any time.