Perform operations
In addition to the basic operations to create, update, delete and query Dataverse data there are also other custom actions that can be used. These actions can be generic utility logic like AISummarize or custom logic specific to a solution. For example, you might have an action ScheduleVisit and when called would find an available technician and assign it to the visit. When using actions, you can provide input information and it can return results as output. You generally don't worry about the logic used by the action internally to accomplish the task. A significant advantage of actions like this is multiple flows and apps can use them, and they consistently do the work the same way. If a change is necessary to the logic, you only have to change the action and then all apps and flows take advantage of the change.
These actions can be native to Dataverse, created by code-first developers using the Dataverse Custom API feature, or made using an instant low-code plug-ins using Power Fx. When you use an action to build your cloud flow, you don’t necessarily know how it was created, just that it's available for you to include in your cloud flow. Actions can be used to make data changes such as creating or updating rows in Dataverse, or can just contain reusable logic.
Actions can be bound or unbound. Bound actions target a specific table row. When you use a bound action, you must provide a reference to the row from that table. Unbound actions aren't bound to a specific table, and are used without the context of a specific table or row. The Dataverse connector has two operations, Perform a bound action and Perform an unbound action that you can use to invoke the actions. When you're creating your cloud flow, you choose a bound action or an unbound action for that step.
A low-code maker might use a low-code plug-in to create an action to perform a calculation. For example, using input from selected currency columns of a table to calculate a debt ratio. From there, you could add logic to enforce policy based on the results of the calculations. In the example below you can see an unbound action in Power Automate to do this.
In the following exercise, you use an action in a cloud flow to send a weekly email with some summary information about active fundraisers. You first need to create the action as a low-code-plug-in.
Exercise - Create a low-code plug-in and use it from a cloud flow
In this exercise, you create an instant low-code plug-in that calculates the average donations for a fundraiser. You then invoke this logic from a cloud flow.
Prerequisites
Access to an environment with Dataverse with sample apps installed if you want to do the following exercise
Task - Create the low-code plug-in
Navigate to Power Platform maker portal and select the correct environment.
Select Apps from the left navigation, select All and then launch the Dataverse Accelerator App.
Select Create instant plug-in.
Enter Calculate Average Donation for Display name and then select the New input parameter button.
Enter TargetFundraiser for Label, select EntityReference for Data type, select sample_fundraiser, and then select the New out parameter button.
Enter AverageDonation for Label and select Decimal for Data type.
Paste this expression in the Expression field and then select the Save button.
{AverageDonation: LookUp(Fundraisers, sample_fundraiserid = TargetFundraiser.sample_fundraiserid).'Total Donations' / CountIf(Donations, Regarding = TargetFundraiser)}
You now get a fundraiser ID that you can use to test the plugin. Start a new browser session, navigate to Power Platform maker portal and select the correct environment.
Select Apps from the left navigation, select All and then launch the Fundraiser application.
Select Fundraisers from the left navigation and open the Scholarship Fund.
Go to the URL and copy the ID of this fundraiser.
You can close the Fundraiser application.
Go back to the plug-in and select the Test button.
Paste the ID you copied in the Value field and then select Run.
The plug-in should run successfully and return the average donation.
You can close the Dataverse accelerator application.
Task - Create flow and use the plug-in
In this task, you use the plug-in you created.
Navigate to Power Automate and select the same environment you created the plug-in.
Select Create from the left navigation, and then select Scheduled cloud flow.
Enter Weekly Fundraiser Report for Flow name, select to repeat 1 every week and run on Mondays, and then select Create.
Select the Insert a new step button and then select Add an action.
Search for list rows and select List rows from the Microsoft Dataverse connector. Follow the prompts to create the connection if needed.
Change the action name to List fundraisers, select Fundraisers for Table Name.
Select the Insert a new step button and then select Add an action.
Search for initialize and select Initialize variable.
Rename the action Initialize averages, enter Donation averages for Name, and select Array for Type.
Select the Insert a new step button and then select Add an action.
Search for perform unbound action and select Perform an unbound action from the Microsoft Dataverse connector.
Rename the step Calculate average, select the CaluculateAverageDonation plugin you created for Action Name, and then select the Show all button.
Type / on the Item/TargetFundraiser/Sample_fundraiser field and then select Insert Dynamic Content.
Search for fund and select Fundraiser from the dynamic content pane.
Power Automate creates a For each and place the Calculate average action inside the for each.
Select the For each and rename it For each fundraiser.
Select the Insert a new step button below the Calculate average action and then select Add an action.
Search for append and select Append to array variable.
Rename the action Append to donation averages, select Donation averages for Name, and paste this JSON in the Value field. You add the dynamic values to this JSON.
{"Name":, "Total Donation":, "Average Donation":}
Type / after "Name": and then select Insert Dynamic Content.
Select Name from the dynamic content pane.
Type / after "Total Donation": and then select Insert Dynamic Content.
Select Total Donations from the dynamic content pane.
Type / after "Average Donation": and then select Insert Dynamic Content.
Select AverageDonation from the dynamic content pane.
The for each should now look like this image. Select the Insert a new step outside the For each fundraiser action and then select Add an action.
Search for HTML table and select Create HTML table from the Data Operation connector.
Type / in the From field and then select Insert Dynamic Content.
Select Donation averages from the dynamic content pane.
Select the Insert a new step button after the Create HTML table action and then select Add an action.
Search for send email and select Send an email (V2). Follow the prompts to create the connection if needed.
Rename the send email action Send report, provide your user's email for To, type Fundraisers Report as Subject.
Type / in the Body field and then select Insert Dynamic Content.
Select Output of the Create HTML table from the dynamic content pane.
Select Save and wait for the flow to be saved.
Don't navigate away from this page.
Task - Test flow
Select the Test button.
Select Manually, and then select Test.
Select Run flow.
Select Done.
The flow should run should succeed.
Navigate to Outlook.
You should receive the fundraiser report email sent by the flow.
The report should like this email.