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.