How to Update a Row in Dataverse Using Power Automate

In this Microsoft Dataverse tutorial, We will see how to update a row in the Dataverse table using Power Automate.

I recently worked on a task where I needed to use Power Automate to update a row in a Dataverse table automatically.

Update a row in Dataverse using Power Automate

In this section, we’ll talk about how to update a row in a dataverse table automatically. Power Automate, which enables the automatic updating of a particular Dataverse row, will be used for this purpose.

Requirement:

First and foremost, understand this requirement and what we need to perform. There is a Dataverse table (Suppliers) containing a number of columns with various data types.

Among all the columns, there is a Choice column i.e. Product Approval Status having some choice values like Approved, Pending, and Rejected.

When a new item is added to the dataverse table, the flow is activated, and the particular record is sent for approval (to two managers). The Product Approval Status field will immediately update and show the value “Approved” once everyone has given their approval for that item.

If any manager decides to reject the approval, the Product Approval Status column will instantly update and show the value “Rejected“. Refer to the image below to see how it appears following the dataverse field update.

Update a row in Dataverse using Power Automate
Update a row in Dataverse using Power Automate

Now let’s begin working through this step-by-step.

Step – 1:

  • The below screenshot represents a Dataverse table named Suppliers. This table has a choice column named Product Approval Status along with several column types like Product Name, Supplier Name, Location, etc.
  • Three options are available in this status field: Approved, Pending, and Rejected. The approval status field’s default setting is Pending.
  • This Product Approval Status field will update automatically based on the Power Automate condition.
Update a row in Dataverse using flow
Update a row in Dataverse using flow

Step – 2:

Now we will create a flow to update the dataverse row. To create it,

  • Sign in to Power Automate.
  • Go to + Create from the left navigation -> Select Build your own under the Create section.
How to Update a row in Dataverse using Power Automate
How to Update a row in Dataverse using Power Automate

Step – 3:

  • To build the custom automation, first, we need to choose a trigger that kicks off our flow.
  • To update a row in the Dataverse table, choose Microsoft Dataverse under the Choose a connector section.
  • Then, Select When a row is added, modified, or deleted under the Choose a trigger section as shown below. Click on Next.
Update a Dataverse row using Power Automate
Update a Dataverse row using Power Automate

Step – 4:

  • The next step when our flow is triggered is to select an action to carry out.
  • Search and select the Approvals action under the Choose a connector section.
  • Then, select Start and wait for an approval under the Choose an action. Click on Next.
How to Update a Dataverse row using flow
How to Update a Dataverse row using flow

Step – 5:

  • The flow will now appear as in the image below. As we need approvals from two persons, that’s why we will add a parallel branch and add the same approvals action on it.
  • Click on the + icon and select Add a parallel branch as below.
Update a Dataverse row using flow
Update a Dataverse row using flow

Step – 6:

  • Search and select Start and wait for an approval under the Approvals action.
Update a Dataverse table row using flow
Update a Dataverse table row using flow
  • Then another parallel approval branch will add to the flow. Moreover, to recognize the action, I just renamed both the approval actions to Manager1 and Manager2.
How to Update a Dataverse table row using flow
How to Update a Dataverse table row using flow

Step – 7:

  • Now expand the trigger action (When a row is added, modified, or deleted) and enter the below field values:
  1. Change type = Seven different change types are available, including added, added or deleted, added or modified, etc. When you want the flow to start, you can choose the type. Since I want to start the flow whenever a new item is added to the Dataverse table, it is set to Added in my case.
  2. Table name = Select the specific Dataverse table name (Suppliers) from that dropdown menu.
  3. Scope = Select the scope as Organization.
power automate update a row dataverse
Power automate update a row dataverse

Step – 8:

  • Next, expand both the parallel approval branches and enter the below field values:
  1. Approval type = Select the approval type as Approve/Reject – Everyone must approve in both branches.
  2. Title = Similarly, set the product name field (Name) from the Dynamic content in both branches.
  3. Assigned to = Provide both the manager names or email ids in each approval. That means, enter the Manager1 name in the Approval Manager1 action and the Manager2 name in the Approval Manager2 action.
Update dataverse table power automate
Update dataverse table power automate

Step – 9:

  • After that, insert a new step or new condition action. Click on the + icon and add a Condition action like the image below.
  • Because we require the approval of two managers to update the row, we need two conditions in this situation. To achieve that, click the And option after expanding the And dropdown menu. The Condition action will now include a new condition.
Power automate update row in dataverse
Power automate update row in dataverse

Step – 10:

  • Click on the first condition field -> Go to the Dynamic content tab-> Select Outcome under the Approval from Manager1 section.
  • Next, select the condition as is equal to from the dropdown menu.
  • Enter Approve in the last field of the first condition.

Refer to the screenshot below.

Update dataverse table row using power automate
Update dataverse table row using power automate

Step – 11:

  • Click on the second condition field -> Go to the Dynamic content tab -> Select Outcome under the Approval from Manager2 section.
  • Next, select the condition as is equal to from the dropdown menu.
  • Enter Approve in the last field of the second condition.

Refer to the screenshot below.

How to update dataverse table row using power automate
How to update dataverse table row using power automate

Step – 12:

  • You are aware that the condition action contains two parts, If yes and If no. Add a new action, Update a row (PREMIUM), under the Microsoft Dataverse action in both sections.
  • Once you have included the actions in the flow, simply rename them.
  • Next, enter the below field values:
    • Table name = Provide the Dataverse table name (Suppliers) from the dropdown menu. This is a mandatory field.
    • Row ID = This is also a mandatory field. Select the unique row identifier under the Dataverse trigger action. Below is the code that contains the Supplier:
triggerOutputs()?['body/tsinfo_supplierid']

I didn’t create any supplierID column in the Suppliers table. It’s taking the list item ID in the Dynamic content under the Dataverse trigger action.

Update dataverse row using flow
Update dataverse row using flow
  • Name = This is optional. Select the Name field under the dataverse trigger section from the Dynamic content.
  • Product Approval Status = Select Approved under the If yes section and select Rejected under the If no section.
Update dataverse row using power automate
Update dataverse row using power automate

Step – 13:

  • That concludes the use of Power Automate. Give the flow a new name (Dataverse Update Row), then Save it.
  • To test the flow manually, click on Test.
Power Automate update a Dataverse row
Power Automate update a Dataverse row

Step – 14:

  • From the Test Flow window, Select Manually and tap on the Test button.
  • To trigger the flow, we need to insert a new record into the Dataverse table (Suppliers). Go to that specific table and add a new record (like Mouse) to it. Here, by default, the Approval status field will display as Pending.
Update Dataverse table row using flow
Update Dataverse table row using flow
  • An email notification will be sent to both managers asking for their approval once you have added the item to the dataverse table.
  • The specific dataverse row will update to Approved when both managers have approved the record.
  • The dataverse row will update to Rejected if one of the managers rejects the request for approval.
How to update Dataverse table row using flow
How to update Dataverse table row using flow

Step – 15:

  • Once all the approval procedures have been completed, the flow will display a successful notification that reads, “Your flow ran successfully“. Refer to the image below.
Use flow to update a Dataverse row
Use flow to update a Dataverse row
  • Finally, refresh the Dataverse table (Suppliers). You can see that the Product Approval Status field has been changed to “Approved” as shown below.
Use Power Automate to update a Dataverse row
Use Power Automate to update a Dataverse row

These are the steps to update a row in Dataverse Using Power Automate.

Furthermore, you may like some more Dataverse tutorials:

In this Microsoft Dataverse tutorial, We discussed how to update a row in the Dataverse table using Power Automate.

>