0

I have a Dataverse table that has a few columns. One of those columns is an Order Number column. There should only be one row per order number. If there is more than 1, only the first one should be kept. How can I do this in Power Automate?

What I have tried so far: First, I created an array of all the order numbers. From there, I feel stuck. I started to add an Apply to Each action, loop through the table, count how many of each order number there are, but then I confused myself and didn't think that was the right way to go.

Or...is there a way to keep the "duplicate" rows from getting added to the Dataverse table in the first place? The data is getting loaded into the table via a JSON load. Is there a way to delete the "duplicate" items from the JSON?

Here's an example of the situation:

| OrderNumber | OrderDate | CustomerName |
| 450123| 2-24-22 | Business A |
| 450123| 2-25-22 | Business A |
| 383238| 2-24-22 | Business B |
Robby
  • 843
  • 3
  • 19
  • 53
  • Have you looked into the duplicate detection functionality that's built in? https://learn.microsoft.com/en-gb/powerapps/developer/data-platform/detect-duplicate-data-with-code – Skin Feb 25 '22 at 01:11
  • I've read that documentation, but it doesn't exactly tell you what to do where. – Robby Feb 25 '22 at 14:22

1 Answers1

0

There is this template flow for finding & removing duplicates in any datasource: https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Find-and-Remove-Duplicates/td-p/2191403