0

I have an output of http action which contains an array of objects and looks like this:

[
{
"Id":1,
"Good":0,
"Average":0,
"Bad":1
},
{
"Id":2,
"Good":1,
"Average":0,
"Bad":0
},
{
"Id":1,
"Good":0,
"Average":1,
"Bad":0
},
{
"Id":3,
"Good":0,
"Average":0,
"Bad":1
},
{
"Id":1,
"Good":0,
"Average":1,
"Bad":0
},
]

How can i combine them to get this result without using inline javascript, using dataoperation action? Basically i need to sum records` values, and combine by ID

[
{
"Id":1,
"Good":0,
"Average":2,
"Bad":1
},
{
"Id":2,
"Good":1,
"Average":0,
"Bad":0
},
{
"Id":3,
"Good":0,
"Average":1,
"Bad":0
}
]
Mateech
  • 1,010
  • 1
  • 11
  • 26
  • There’s an aggregate function in the Advanced Data Operations connector … https://learn.microsoft.com/en-us/connectors/advanceddataoperatio/#aggregate … it’s quite affordable too. – Skin Jul 13 '23 at 20:08
  • @Skin i think it`s available only for standard logic apps – Mateech Jul 14 '23 at 08:40
  • No, it’s consumption. You just need to sign up for a trial … https://www.statesolutions.com.au/pricing/ – Skin Jul 14 '23 at 09:55

1 Answers1

1

This is an example of how to achieve what you're wanting by using the Aggregate operation in the Advanced Data Operations connector.

This is your data configured to SUM the Good, Average and Bad properties by the Id field.

Flow

Output

Output

Result

[
  {
    "Id": 1,
    "Good": 0,
    "Average": 2,
    "Bad": 1
  },
  {
    "Id": 2,
    "Good": 1,
    "Average": 0,
    "Bad": 0
  },
  {
    "Id": 3,
    "Good": 0,
    "Average": 0,
    "Bad": 1
  }
]
Skin
  • 9,085
  • 2
  • 13
  • 29
  • Looks indeed very powerful, thanks, i will put this one in bookmarks. Unfortunately i am limited with build-in actions in this case :( – Mateech Jul 14 '23 at 13:02
  • 1
    That's a shame because doing what you want in the flow will be a pain in the butt without the use of this connector. This operation makes it hell easy. You could do it using XML but you'll need to fashion up an XLST I'd say and that will require an integration account, etc. A bit more work than what I've shown you. Good luck anyway. – Skin Jul 14 '23 at 13:14