web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Microsoft Dataverse Business Events

Amira Beldjilali Profile Picture Amira Beldjilali

Context

 Several capabilities already exist in the Microsoft Dataverse to relay events to subscribers, and a new way has been announced recently to expose events and compose business logic to respond to them asynchronously. 

The main purpose of Dataverse Business Events is to allow citizen developers and professional developers to trigger business events. That is, when an action happens in one business application, other business applications can now be informed about them.

Overview

The following schema shows a high-level view of the steps that will be detailed in this article to explain how Business Events works:

Global steps to trigger a Business Event

  1. An external system calls an Action or Custom API that has been provided to trigger the Business Event.
    1. The Action or Custom API is triggered with the Request Parameters, which contain information about the external event that occurred.
  2. The action triggers the Business Event that performs some business logic asynchronously.

How does it work?

This article implements the following scenario (presented also in this documentation Microsoft Dataverse business events - Power Apps | Microsoft Docs):

You have an ERP application that has an OnVendorPaymentPosted event and you want to simplify how you centralize your automation logic. You can create a custom API representing this external event and configure the ERP application to call this Dataverse API. When you catalog this custom API as an event, you’ll be able to use the Dataverse Power Automate connector to use this event as a trigger and send an email.

 For this example, it is expected nothing will be done in Dataverse except enable asynchronous logic to be registered for the event.

 Diagram describing the scenario

In order to implement this scenario, we’ll go through the following steps and considerations:

  Diagram describing the steps to follow to implement the scenario

Create the Custom API

Create the Custom API with the parameter, which is Vendor ID in this example. (For more details, refer to Create and use Custom APIs (Microsoft Dataverse) - Power Apps | Microsoft Docs.)

 Custom API and Custom API Request Parameter

At the end of this step, your solution should contain the following components:

Solution after the creation of the custom API

Create the Catalog and the Catalog assignment

A Catalog is a structure to expose actions as business events. It’s a hierarchical structure where the top level represents a solution. (For more details, refer to Catalog and CatalogAssignment tables (Microsoft Dataverse) - Power Apps | Microsoft Docs.)

 In the example, we create the Catalog with the following structure:

Catalog

Description

Contoso Manufacturing

Root Catalog

Contoso Manufacturing Vendors Catalog

 

2nd Level Catalog Category

OnVendorPaymentPosted Assignment

Catalog Assignment: Custom API

 Catalog and Catalog Assignment

At the end of this step, your solution should contain the following components:

 Solution content

Create the Power Automate flow

  • Create the cloud flow from the solution you’re working on.

 Power Automate flow creation

  • Configure the trigger by setting the Catalog, the Category, and the Action created in the previous steps.

 Power Automate flow trigger configuration

  • Configure the action, for example, by sending an email to an admin.

 Power Automate flow action configuration

 

At the end of this step, your solution should contain the following components:

  Solution content at the end of the scenario

Test the Business Event

For test purposes, Postman will be used to simulate the Custom API triggering. Several community tools exist to do this. (For more details, refer to Set up a Postman environment (Microsoft Dataverse for Apps) - Power Apps | Microsoft Docs.)

  • Trigger the Custom API – OnVendorPaymentPosted.

 Custom API call via Postman

 

  • Once the Custom API is triggered, check the run history of the Power Automate flow created previously. A new run history appears.

 Power Automate run results

Power Automate Flow run results

Custom API call test with Power Automate Flow run results

To conclude, Business Events can be used in several scenarios, they provide a new way to discover events and create automation when these events occur. For more details concerning the design principals and points to consider, refer to Microsoft Dataverse business events - Power Apps | Microsoft Docs

Comments