
Announcements
I have a large dataset of 8000+ records that needs to be grouped by the id and then create the output as an xlsx file. I know how to do the latter half through office scripts, but doing the first part of this (grouping by the id) through an apply to each is off the table because of the large dataset.
A sample is as such:
firstname: Bob, lastname: Smith, id: 123, state: IL,
firstname: Bob, lastname: Smith, id: 123, state: MO,
firstname: Bob, lastname: Smith, id: 123, state: PA,
firstname: Bob, lastname: Smith, id: 123, states: TX,
firstname: Jane, lastname: Doe, id: 234, states: CO,
firstname: Jane, lastname: Doe, id: 234, states: NY,
firstname: Jane, lastname: Doe, id: 234, states: IL,
firstname: Jane, lastname: Doe, id: 234, states: PA
I need to create a flow where it can group by the id and return an array where each record is unique where it looks like this:
firstname: Bob, lastname: Smith, id: 123, states: IL, MO, PA, TX
firstname: Jane, lastname: Doe, id: 234, states: CO, NY, IL, PA
My first thought was to do this partially in Power Automate and partially in PowerApps by grabbing the records inPower Automate, do a select statement, and then send a response to PowerApps to use the GroupBy function. In PowerApps, capture the results of the response in a collection, and group the collection by the id, and then do a Concat of the states in the gallery. Then send this grouped collection back to a second flow that creates the csv table and the xlsx file using office scripts.
Seems like a lot of back and forth. My question: Is there a way to GroupBy in Power Automate without doing an apply to each? If so, please provide an example of steps or point me to a video. I've searched and all of the videos are using apply to each.
Thanks so much!
Hi @Ks4 ,
No, there is no such a Function like PowerApps'"GroupBy" in Power Automate. If you want to do "GroupBy" in a flow, I'm afraid the only way is to using 'Apply to each'. But you can create a new idea through the below URL, then ask your colleagues to raise up the votes.
Power Automate Ideas - Power Platform Community (microsoft.com)
The product team has direct visibility of these ideas and they will implement it on the basis of the highest number of votes received.
Best Regards,
Bof