0

I have an multi-property array that I want to remove almost-duplicates from. There could be duplicate Order Numbers in the items in the array. The Schedule Date could be different, however.

How can I change the Schedule Date to match the first item with that Order Number in the array? Or is there a way to remove the items entirely that are duplicates of the first array item?

If they were exact duplicates, I know I could do this: union(variables('varArray'), variables('varArray'))

However, I only want to look at one property of the array (OrderNumber) to determine what's a duplicate or not. Is there a way I can remove these almost-duplicates from an array? It would be similar to using the Distinct function in Power Apps where I would do something like, Distinct(varArray,OrderNumber).

Example data: In this example, I want to either get rid of the second and third items entirely, or ensure the Schedule Date of the second and third items match the first item. Then I can use the Union expression to get rid of the duplicates that way.

enter image description here

Robby
  • 843
  • 3
  • 19
  • 53
  • 1
    Can you provide some example data and maybe screenshots? – Skin Feb 28 '22 at 05:12
  • I have added some example data. I do a list rows on that and turn that into an array. Each order number has 2 rows. Order 234567 has the exact same data, so if I run a union on the array with itself, it eliminates the exact duplicate. I want to do the same sort of thing for the first order, 123456, but since the OrderDate isn't exactly the same, the union expression doesn't work. – Robby Feb 28 '22 at 17:28

0 Answers0