Triggers

Completed

Power Automate defines a trigger as an event that starts a cloud flow. These events can be initiated by a user, are scheduled, or are generated by a connector, including custom connectors.

The triggers used in Power Automate are defined by connectors. Each connector has its own set of triggers. Connectors are divided into two groups:

  • Tabular - These connectors are for data sources where the data is stored in tables. Dataverse is a tabular connector. Tabular connections will have triggers around creating, updating, and deleting of records.
  • Function-based - These triggers are for cloud services such as Twitter or Microsoft Outlook. The triggers are related to functions in those services. For instance, the Outlook connector has a trigger for when an email is received.

Trigger types

Three types of triggers for initiating Power Automate cloud flows are:

  • Automated - A flow started by a defined connector event, such a new record creation or a file appearing in a particular folder.
  • Instant - A flow initiated by a user, such as a button selection in an app.
  • Scheduled - A flow that runs on a recurring basis, such as at 9:00 AM every workday, or every hour.

This section focuses on using Dataverse trigger. Data events can trigger Automated flows. The Dataverse connector has several automated triggers. The most used is when a record is created, modified, or deleted. There are also triggers for when a row is selected and when an action is performed. Let's focus on the "When a row is added, modified or deleted" for a moment.

In the trigger step, you specify the trigger condition:

  • Added
  • Added or deleted
  • Added or modified
  • Added or modified or deleted
  • Deleted
  • Modified
  • Modified or deleted

The Dataverse connector has a single instant trigger when a flow step is run from a business process flow. This feature allows a user within a business process flow step to initiate a Power Automate cloud flow.

The Dataverse connector has a single instant trigger when a row is selected. This feature allows a user using a model-driven app form to manually initiate a Power Automate cloud flow.

For example, a common pattern that is used with Power Automate cloud flows is to use the Scheduled trigger to run feature to retrieve all rows that are due for the day and then loop through and process them on a daily basis. This flow could call a child flow with a Dataverse trigger.

Poll vs. push triggers

Triggers represent notifications to Power Automate cloud flows that an event has occurred. Triggers are grouped into two types: poll and push. A polling trigger makes a call into the API at a reoccurring frequency to check for new messages. When new data is available, the trigger runs the flow. Examples of poll triggers include timer triggers. A push trigger responds to a push of new data from the service.

When you're using triggers, indication of whether a trigger is poll or push will be invisible to you. The deprecated Dynamics 365 connector used polling triggers; the more modern Dataverse connector uses push triggers. Push triggers are more efficient and are more real-time.

Not every connector has a trigger. In such cases, you can use a scheduled trigger and then retrieve the data that has changed since the previous run. In other words, this uses a polling pattern. If you use this pattern, you need to ensure that you don't run the flow too often, and you should leave several minutes between each iteration.

Use filters

Solution architects should consider minimizing the number of flow runs for each cloud flow. A common mistake that many people make with Power Automate when creating and updating triggers is to retrieve the row and then have a condition that checks if the flow needs to do anything. With Dataverse connectors, you don't need to retrieve the row; the trigger step contains the new/changed data.

Additionally, like other triggers, Dataverse connectors can have a filter applied to the trigger. A filter, including Select Columns and Filter Rows, limits the data that the trigger views and reduces unnecessary runs.

Screenshot of the connector with filters on the trigger.

Here's how these two filters work:

  • Select columns - The flow only triggers if a change occurs in any of the columns designated in the comma-separated list of column unique names.
  • Row filter - An OData expression can limit which rows can trigger the flow. In other words, the flow only considers rows meeting the condition.

In Dataverse, if a column is included in a trigger's output, it doesn't mean that the value of the column has changed. If you need to ensure that you only process changed values, you need to use a plug-in with Pre and Post-Images.

Note

Instant triggers are not currently visible from apps if the flow is in a solution.