We will learn to build & implement Low Code Plug-ins within Dataverse / Power Apps. Before we start, make sure to subscribe to CRM Crate so that you can stay up to date in the field of Power Platform.
Microsoft Dataverse provides a robust approach to enhance data architecture efficiency and diminish client-side processing demands by utilizing low-code plug-ins. These plug-ins are reusable, real-time workflows that execute designated commands within Dataverse, operating on the server-side and activated by custom event handlers.
In the past, plug-ins were developed as custom classes compiled into a .NET Framework assembly, which were subsequently uploaded and registered in Dataverse. Nevertheless, the arrival of low-code plug-ins now allows users to developer & configure these event handlers with little to no coding, eliminating the necessity for manual registration.
Dataverse Low-code plug-ins reside within a Dataverse data-model and can be effortlessly incorporated into Power Apps and Power Automate. The workflow’s behavior is determined using the Power Fx formula / expression language and can establish direct connections with Dataverse business data and external data sources via Power Platform connectors. Thanks to low-code plug-ins, developers can swiftly build simple workflows with minimal coding knowledge, leading to a more efficient and streamlined data architecture.
Advantages of server-side logic
Server-Side customizations provide multiple benefits as stated below.
Better ScalabilityServer-side logic can be scaled with greater ease compared to client-side logic, facilitating improved performance and enhanced management of heavier workloads.
Enhanced PerformanceBy executing on the server, business logic has the potential to decrease the volume of data that must be transmitted between the client and server, leading to quicker processing times.
Easier maintenance and upgradesThrough the centralization of business logic on the server, maintenance and updates become more convenient, as modifications can be implemented in a single location instead of necessitating updates across multiple clients.
Improved SecurityAs server-side logic runs on the server, it can aid in preventing unauthorized access to sensitive data or table rows.
Reliability & ConsistencyServer-side logic guarantees the consistent application of business rules across all clients, mitigating the risk of errors or disparities.
Understanding Low Code Plug-ins
Low-code plug-ins are Power App components that enable you to incorporate business logic into your applications using the Power Fx forumula / expression language, and seamlessly connect with Dataverse business data and external data sources through Power Platform connectors. These low-code plug-ins empower you to rapidly construct robust workflows without the need for any manual coding.
There are two types of low-code plug-ins supported in Dataverse as given below.
|Type||Trigger||Supports parameters||Supported scope|
|Instant||Manually run||Yes||Global and table|
|Automated||Dataverse table event||No||Table|
Instant Plug-insAn instant low-code plug-in is custom code logic that is manually triggered by an application user. Custom input and output parameters can be used in this scenario.
|Scope||This is a setting used to link a plug-in with a particular table / entity. This setting can be configured as either “table” (referred to as “entity”) or “global.” In the context of table (entity) scope, the plug-in is activated within the context of a specific table record, while global scope indicates that the operation is not linked to a particular table (for more information, see link).|
|Parameters||Parameters allow you to pass information between the plug-in and the context that runs it, making it easier to design business logic that can be reused in varying situations.|
Input parameters are used to provide data to the plug-in, and allow you to control how the function behaves by passing in different values you specify in the Power Fx formula.
Output parameters allow you to retrieve the results of a function or method for further use in your program.
Supported data types: Boolean, String, Float, Decimal, Date Time & Integer
Automated Plug-insAn automated low-code plug-in is custom code that is triggered and executed in response to a particular data event.
|Data event||Indicates which data event triggers the plug-in. Any of the following events can be selected to invoke the plug-in: Create, Update & Delete|
|Stage||You have the ability to determine whether the plug-in operates prior to or following the completion of the data event, offering the flexibility to access and modify values at crucial stages of the event.|
Pre-operation. Select this option if you want to run your plug-in logic after the form validation, but before the values are inserted or changed in Dataverse.
Post operation. Select this option to run your plug-in logic after the values have been inserted or changed in Dataverse.
What are the Prerequisites for building a Low Code Plug-in?
Below are the basic prerequisites for creating low code Plug-in.
|1||User with System Admin / System Customizer security role.|
|2||Access to the Dataverse accelerator app.|
Steps for building a Low Code Plug-in
Step 1: Login with an admin user in Power Apps and play the Dataverse Accelerator App as shown below.
Note: – If you do not have Dataverse Accelerator App pre-installed in your environment, then navigate to the below given link to install Dataverse Accelerator.
Dataverse Accelerator ‘App Source’ Link – Click Here.
Step 2: Within the Dataverse Accelerator app, you can find options to create new low code Plug-ins as shown in the below interface.
Step 3: For demo purpose, we will create a new ‘Instant Plug-in’ as per the details given below.
- Display Name: Name of your plug-in.
- Parameters: Define input and output parameters for your plugin. The input parameters will be supplied to the plugin and the output parameters will be released out by the plug-in in form of response or outcome. In our case, we will be providing an input parameter as ‘Total Revenue’ and the plugin will divide the ‘Total Revenue’ by 30 and provide its output as ‘Daily Revenue’ in an output parameter.
- Expression: You can write your Power FX expression here for performing the data computation and operations.
- Solution: Select the solution where you want to deploy and store the plug-in.
- Name: Define a schema / logical name for your plug-in.
- Description: Define a descriptive text for your plug-in.
- Scope: You can define the scope for your plug-in. If the scope is set to entity, use
ThisRecordto access column values in the table row associated with the plug-in run, such as
ThisRecord.'CRM Crate Field Name'.
- Select Save once done.
Note: – You can also add connection references to your plugin by clicking on the connection icon as shown below.
Step 4: Now lets test your newly created low code plug-in. Within the same window, click on ‘Test‘ for testing / debugging the plug-in.