Robby
Robby

Reputation: 827

Delete partial duplicates in an array

Using Power Automate, I would like to remove partial duplicate items in an array. Below is an example. How can I end up with only 2 items (order numbers 123 and 456) in the array?

[
  {
    "cr52a_ordernumber": "123",
    "cr52a_date": "12-15-22"
  },
  {
    "cr52a_ordernumber": "123",
    "cr52a_date": "12-14-22"
  },
  {
    "cr52a_ordernumber": "123",
    "cr52a_date": "12-16-22"
  },
  {
    "cr52a_ordernumber": "456",
    "cr52a_date": "12-17-22"
  },
  {
    "cr52a_ordernumber": "456",
    "cr52a_date": "12-18-22"
  }
]

Upvotes: 0

Views: 140

Answers (1)

Skin
Skin

Reputation: 11262

The Advanced Data Operations connector has an operation for exactly this purpose. There is a small cost per month if you decide to sign up but you can get a trial and see what else it has on offer as to whether or not you find it useful.

This is what I tested with ...

Flow

Your array of data is contained within the first Initialize Order Array step.

This is the end result ...

Result

Upvotes: 1

Related Questions