Hi all, I am trying to group and sum up my array. It should sum up the amount (Anzahl) of items with equal ids (Artikelnummer),
Here is input example:
[
{
"Artikelnummer": "18136",
"Anzahl": 1
},
{
"Artikelnummer": "18760",
"Anzahl": 1
},
{
"Artikelnummer": "12352",
"Anzahl": 4
},
{
"Artikelnummer": "12352",
"Anzahl": 5
}
]
and I expect to get this output:
[
{
"Artikelnummer": "18136",
"Anzahl": 1
},
{
"Artikelnummer": "18760",
"Anzahl": 1
},
{
"Artikelnummer": "12352",
"Anzahl": 9
}
]
The data comes from Dataverse as output of List rows action. I would prefer some solution in Dataverse (some kind of view for the table using GroupBy), unfortunately I have found any.
Getting the output from Dataverse within List rows would be the prefferable solution but as far as I know, aggregation is not supported there.
I have tried to use an approach with Apply to each and array variable, but faced two problems:
- the current item was not evaluated within the Condition / Apply to each
- this approach takes too long and the transformation should not take more than 1-2 seconds even if the array contains up to 100 items