DEV Community

Cover image for Automated Functions in Dataverse & Low-Code Plug-ins
david wyatt
david wyatt Subscriber

Posted on

3 2 1 2 1

Automated Functions in Dataverse & Low-Code Plug-ins

This is the second in the series, so make sure you read the 101 blog first.

dataverse accelerator

Functions in Dataverse and Low-Code Plug-ins are the same and not the same. In the future everything may be in Functions in Dataverse, but as on writing Automated Plug-ins are only in the Dataverse Accelerator.

  1. What Are Automated Plug-ins
  2. How to Create one
  3. The Code
  4. Bugs
  5. Quick Example

1. What Are Automated Plug-ins

Automated plug-ins, I suspect are the future replacement of Business process.

business process

Business Process add logic to a Dataverse table beyond a simple calculated column. They can do validation, conditions, update other tables, trigger flows, etc.

So a Automated plug-in is linked to a Dataverse table, and on an event (Create, Modify, Delete), the script will run. As by the name, you may have guessed this script uses Power FX, the same language in Power Apps and calculated columns.

2. How to Create one

After installing the Dataverse Accelerator app go to make.powerapss, and view all Apps, you should see the Dataverse Accelerator App

Dataverse Accelerator App

Open the Model Driven app and you will see 4 options:

  • Create instant plug-in (next blog)
  • Create automated plug-in (that's the one)
  • Plugin monitoring - run history of all plug-ins
  • API Explorer - test Dataverse API's, including instant plug-ins

Click on Create automated and you will see the build screen

build screen

There are the following inputs:

Display Name

Your Plug-in, this is also its unique name, so cant have the same name as another plug-in (unlike Apps and Flows).

unique name

Table

This is the table that the plug-in is linked to, so interactions with it trigger the plug-in and all internal referenced functions are to this table.

Run this plug-in when the row is

What interaction with the table triggers the plug-in, Created, Updated, Deleted. Unlike Power Automate flows you can only select one, not multiple.

Expression

This is the main coding input where the Power FX code is

When should this run

This is when the code should run, Pre-operation will run after validation of the inputs but before the data is written to the table, Post-operation runs after the data has been written to the table.

Solution

Low-Code Plug-ins are solution aware, so can be added to a solution for ALM. Although you can add the plug-in to a solution later, by selecting here it is not only added but inherits the solutions publisher prefix.

Once created the only way to test is to trigger by a table interaction (no reruns like in Power Automate).

3. The Code

As there are no direct inputs or outputs like in Instant, all code runs internal, with data flowing in and out from the linked table, any other Dataverse table, or Connection.

To reference the linked table you use 'NewRecord', as 'ThisRecord' is used for filters/lookups etc.

update column

You can also use more advanced functions like filter etc,

filter

In the above example the filter is on the linked table, but it can be any table (within the environment, there is no cross environment support).

You can also add validation by using the Error() function.

error function

This is where the Pre-operation setting is important, as this will stop the record being written if it errors, while post will create the record and then flag as error.

error on record creation

To add the super power of Low-Code Plug-in's (Connections), click the Connections button in the top right of the screen. Here you will see a list of all of your connection references.

connections

Once the reference is selected you will see all of the actions you see in Power Automate. Select and click the Copy to add the action to your clipboard, then paste in your code.

create connection

The parameters follow the same as in Power Automate and Power Apps, so if you remember them just follow the same order. But to make it a lot easier we have intellisense, this will show you the parameters needed.

intellisens

Now whenever a error is created the record is still added but sends an email.

send email

4. Bugs

In 101 I did say that a lot of bugs had been fixed, but sadly not all. There are still lots of issues, especially with connectors.

Although Outlook works, SharePoint not so much. In Automated I always get errors "unknown or unsupported function in namespace {connectionRefName}" errors. It states it implies its a connection reference issue, but its not as its with all connections. In Instant plug-in's I don't always get it, but then there are more issues (see next blog).

post item not working

I will also get the same error occasionally with Outlook, but if I copy the code to a new Plug-in it works.

outlook error

The sad thing is with Functions in Dataverse not doing non Dataverse Connections, the deprioritizing of Low-Coding Plug-ins, and the lack of Copilot being involved, its unlikely these bugs will be fixed anytime soon.

5. Quick Example

As these are embedded with Dataverse they add a lot of functionality to Model Driven apps.

A quick and cool example is in App notifications. As long as you have enable in App notifications you can use the XSendAppNotification() function in your plug-in.

notification code

Then as soon as the event is triggered it will notify the user in the app (in my case its whoever modified the record, but it could be the owner or anyone).

in app notification


I have at least one follow on blogs coming over the next few weeks going into more detail abput instant plug-ins. Subscribe below if you want to be notified (or click the links if you are reading this in the distant future).

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (3)

Collapse
 
michael_brown_ad86beef9b5 profile image
Michael Brown

I thought low-code plugins weren't supposed to be used as they're being replaced by functions?

Collapse
 
wyattdave profile image
david wyatt

Low-code plug-ins have been deprioritized, so eventually I Suspect so. But there is a massive feature gap they can't, as in functions can't be automated at the moment so you have to use plug-ins. Check out previous blog in the series, goes into more detail on it

Collapse
 
michael_brown_ad86beef9b5 profile image
Michael Brown

Totally agree...pretty silly when they basically tell you not to use something that offers critical functionality and give a replacement that's very much still WIP

Tiger Data image

🐯 🚀 Timescale is now TigerData: Building the Modern PostgreSQL for the Analytical and Agentic Era

We’ve quietly evolved from a time-series database into the modern PostgreSQL for today’s and tomorrow’s computing, built for performance, scale, and the agentic future.

So we’re changing our name: from Timescale to TigerData. Not to change who we are, but to reflect who we’ve become. TigerData is bold, fast, and built to power the next era of software.

Read more

👋 Kindness is contagious

Discover fresh viewpoints in this insightful post, supported by our vibrant DEV Community. Every developer’s experience matters—add your thoughts and help us grow together.

A simple “thank you” can uplift the author and spark new discussions—leave yours below!

On DEV, knowledge-sharing connects us and drives innovation. Found this useful? A quick note of appreciation makes a real impact.

Okay