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.
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.
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.
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.
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.
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.
Step – 6:
- Search and select Start and wait for an approval under the Approvals action.
- 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.
Step – 7:
- Now expand the trigger action (When a row is added, modified, or deleted) and enter the below field values:
- 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.
- Table name = Select the specific Dataverse table name (Suppliers) from that dropdown menu.
- Scope = Select the scope as Organization.
Step – 8:
- Next, expand both the parallel approval branches and enter the below field values:
- Approval type = Select the approval type as Approve/Reject – Everyone must approve in both branches.
- Title = Similarly, set the product name field (Name) from the Dynamic content in both branches.
- 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.
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.
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.
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.
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.
- 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.
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.
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.
- 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.
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.
- Finally, refresh the Dataverse table (Suppliers). You can see that the Product Approval Status field has been changed to “Approved” as shown below.
These are the steps to update a row in Dataverse Using Power Automate.
Furthermore, you may like some more Dataverse tutorials:
- How to Enable TDS in Power Platform Admin Center
- How to Detect Text in Dataverse Using AI Builder
- How To Get Row by ID From Dataverse Table
- How To Get Dataverse List Rows Count Using Power Automate
- How to work with dataverse formula column
- How To Remove Commas From Dataverse Number Field
- Power Apps Dataverse Yes/No Field
- Dataverse Version History
- Power Apps Add Data to Dataverse Table
- Invalid Connection. Please Choose a Connection Power Automate
In this Microsoft Dataverse tutorial, We discussed how to update a row in the Dataverse table using Power Automate.
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com