Power Automate Dataverse Update Multiple Rows

In this Power Apps Dataverse tutorial, We will discuss how to work with Power Automate Dataverse Update Multiple Rows.

Also, we will see how to use Power Automate Condition while working with Power Apps Dataverse.

While I was working with Power Apps Dataverse, I needed to update multiple rows at a time in the Dataverse table. I didn’t want to manually update each record in a large table in that situation. Moreover, updating each row will take a long time.

To get around this, I used Power Automate, which enables quick updating of bulk records in the Dataverse table whenever an action is performed.

Also, Read: Power Automate Dataverse Upload a File or an Image

Power Automate Dataverse Update Multiple Rows

Think of a situation when you want to update several records at once in a Dataverse Table without doing it manually.

Power Automate can then be utilized to assist you in updating many rows in the Dataverse table whenever an action occurs. Let’s use the example below to know more.

Scenario:

The below screenshot represents a Dataverse table named Voter Application Forms. This table has various columns with different data types. Such as:

  1. Applicant Name = This is the Dataverse Primary Column name with the Text data type
  2. Date Of Birth = Date Data type
  3. Gender = Choice (Single value) Data type having some choices like Male, Female, Others, etc.
  4. Age = Number Data type
  5. Patient/Spouse Name = Single line of text Data type
  6. District = Choice Data type having choices like Alabama, Alaska, Florida, etc.
  7. State = Choice Data type having choices like 123 Whitefield, New Bohemia, Czech Village, etc.
  8. Is Eligible = This is a Single line of text data type. These field values are blank because we need to update all the values using Power Automate.
Power Automate Dataverse Update Multiple Rows
Power Automate Dataverse Update Multiple Rows

Now I would like to build a flow when a user will click on the flow button, then the flow will trigger and all the rows will update in the Dataverse table based upon the condition.

Here, I’ve included a condition that updates the value to “Eligible” in the Dataverse Is Eligible field if the applicant’s age is greater than or equal to 18. If not, the value will be updated in the Dataverse Is Eligible column as “Not Eligible.” Refer to the screenshot below.

Power automate update all dataverse list items
Power automate update all dataverse list items

To work around this scenario, follow the instructions below:

See also  Network error when using Patch function: Field 'Title' is required

Step – 1: [Create a new Instant cloud flow]

  • Open Power Automate and Sign in with your valid Microsoft credentials.
  • Go to + Create (from the left navigation) -> Select Instant cloud flow under the Start from blank section.
Bulk update dataverse using Power automate
Bulk update dataverse using Power automate

Step – 2: [Provide Flow name and Choose the trigger]

  • Then the below window will appear where you need to provide the flow name and choose the flow trigger.
    • Flow name = I have given the flow name as Dataverse Update Multiple Rows in Flow.
    • Choose your flow’s trigger = Select the trigger from the list below to create a flow. In my case, it’s Manually trigger a flow.
  • Click on Create.
Power automate bulk update dataverse
Power automate bulk update dataverse

Step – 3: [Rename the trigger and click + to add a new action]

  • Once the flow has been created, the trigger (Manually trigger a flow) will appear as shown in the screenshot below. If you want to rename this trigger, then rename it. Don’t add or change anything to this trigger.
Power automate bulk update dataverse table
Power automate bulk update dataverse table

Step – 4: [Add Dataverse List Rows action]

  • Next, click on the + icon to insert a new step below the trigger (Manually trigger a flow).
  • Search List Rows in the search bar -> Select Microsoft Dataverse -> Click on List rows (PREMIUM) under the Actions tab.
Dataverse bulk update using Flow
Dataverse bulk update using Flow
  • Once the List rows action has been added, just select the Dataverse Table name (Voter Application Forms) from the dropdown menu.
Power Automate update Dataverse items
Power Automate update Dataverse items

Step – 5: [Insert a Condition control]

  • Then, click on the + icon to insert a new step below the List rows action.
  • Search Condition in the search bar or add Condition under the Actions tab.
Update multiple records in Dataverse using Power Automate
Update multiple records in Dataverse using Power Automate
  • Once the condition has been added, it will look like the screenshot below.
How to update multiple rows in Dataverse using Power Automate
How to update multiple rows in Dataverse using Power Automate
  • Now, select the first block of the condition -> Go to the Dynamic content -> Select Age under the List rows action. When you will select age, then the Apply to each action and its value will add automatically.
  • Select the second block and choose the condition “is greater than or equal to” from the dropdown menu.
  • Select the third block and mention the value as 18 (As I want to update the Dataverse rows based on age 18).
How to update Dataverse bulk records using Power Automate
How to update Dataverse bulk records using Power Automate

Step – 6: [Update Dataverse Rows If Condition Satisfies]

  • Next, go to the If yes block (left side) and add Update a row [PREMIUM] action (Search Update a row -> Select Microsoft Dataverse -> Click Update a row [PREMIUM]).
Update Dataverse bulk records in Power Automate
Update Dataverse bulk records in Power Automate
  • Just rename the action to Update Dataverse Rows to Eligible and add all the fields below:
    • Table name = Select the Dataverse table (Voter Application Forms) name from the dropdown menu.
    • Row ID = Select the field -> Go to Dynamic content -> Select Voter Application Form [Unique identifier for entity instances].
    • Applicant Name, Age, Date Of Birth, and so on = All these fields you can add from the List rows action under the Dynamic content tab.
    • Is Eligible = You can provide the custom value (Eligible) that you want to update in the Dataverse.
Dataverse update multiple rows using flow
Dataverse update multiple rows using flow

Step – 7: [Update Dataverse Rows If Condition does not Satisfy]

  • Similarly, go to the If no block (right side) and add Update a row [PREMIUM] action (Search Update a row -> Select Microsoft Dataverse -> Click Update a row [PREMIUM]).
  • Just rename the action to Update Dataverse Rows to Not Eligible and add all the fields below:
    • Table name = Select the Dataverse table (Voter Application Forms) name from the dropdown menu.
    • Row ID = Select the field -> Go to Dynamic content -> Select Voter Application Form [Unique identifier for entity instances].
    • Applicant Name, Age, Date Of Birth, and so on = All these fields you can add from the List rows action under the Dynamic content tab.
    • Is Eligible = You can provide the custom value (Not Eligible) that you want to update in the Dataverse.
Update bulk records in Dataverse using Power Automate
Update bulk records in Dataverse using Power Automate
  • Now the whole condition action will look like the image below.
Power Automate Update bulk records in Dataverse
Power Automate Update bulk records in Dataverse

Step – 8: [Save and Test the flow]

  • Finally, Save the flow. Click the flow checker as well to see if there are any problems.
  • If so, fix it. If not, move on to testing the flow. Choose Test.
Update Dataverse multiple records using flow
Update Dataverse multiple records using flow
  • In the Test Flow pane, select Manually and click on Test. In the Run flow pane, tap the Run flow button -> Select Done as shown below.
Update list of Dataverse records using Power Automate
Update list of Dataverse records using Power Automate

Step – 9: [Flow Succeded]

  • When the flow has been completed successfully, a message such as “Your flow ran successfully” will appear at the top of the flow.
How to update dataverse multiple records using flow
How to update dataverse multiple records using flow

Step – 10: [Refresh Dataverse Table]

  • Refresh the relevant Dataverse table (Voter Application Forms) once more at this time. You can see all the custom value has been updated based on the flow condition.
  • That means, if any applicant’s age is greater than or equal to 18, then that specific row has been updated to Eligible otherwise Not Eligible (in the Is Eligible field).
Update dataverse multiple rows using flow
Update dataverse multiple rows using flow

This is how to work with Power Automate Dataverse Update Multiple Rows.

See also  How to Replace Commas with New Lines in Power Automate?

Furthermore, you may like some more Dataverse and Power Apps tutorials:

In this Power Apps Dataverse tutorial, We discussed how to work with Power Automate Dataverse Update Multiple Rows.

Also, we saw how to use Power Automate Condition while working with Power Apps Dataverse.

>