cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Joaquinces
Level: Powered On

Sort/join/group rows by columns content

Hi guys,

I would appreciate if you could help me to build up a flow for sorting and grouping tasks depending on the people responsable for doing them. The final aim of the flow is to send just one email with all the tasks (in the email body) to the responsables.

The tasks are specified in a Text column,  whilst the responsables are in Person or Group column format.

The Sharepoint list with the data looks like this:

tasks.png

Conceptually, the flow should be something like this:

1. Classify tasks by Responsables.

2. Join or group tasks with the same Responsable.

3. Send just one email, with email body of the "joined" tasks, to each Responsable.

In the example, the results of the flow that I expect is:

John's tasks: {task1; task4} ---> Email body for John message

Mike's tasks: {task2; task5} ---> Email body for Mike message

Bruce's tasks: {task3} ---------> Email body for Bruce message

For better understading please check this post:

https://powerusers.microsoft.com/t5/Building-Flows/Email-content-with-multiples-rows-from-a-sharepoi...

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Sort/join/group rows by columns content

Hi @Joaquinces,

 

No, it is not manually define. It just to get all responsable names store in an array, then use the union() function to process the array to remove duplicate names:

Or you can consider store this email address into the Array instead of name, it will be better way.

Annotation 2019-10-31 142142.png

 

Annotation 2019-10-31 142204.png

 

Annotation 2019-10-31 142227.png

 After that, use the Apply to each to Get corresponding items (tasks) of the user. 

Annotation 2019-10-31 152629.png

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Sort/join/group rows by columns content

Hi @Joaquinces,

You can use the union() function to process the array of Responsables, convert the array[John, Mike, Bruce, John, Mike] into [John, Mike, Bruce]. Then you can create a object array to hold these task by using two Apply to each actions, just like:

[

{

"Responsables": "John",

"Tasks": "task1, task4"

},

{

"Responsables": "Mike",

"Tasks": "task2, task5"

},

{

"Responsables": "Bruce",

"Tasks": "task3"

}

] 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Joaquinces
Level: Powered On

Re: Sort/join/group rows by columns content

Thanks @v-litu-msft for your reply.

Please consider that the example table is a simplified version of the actual Sharepoint list. The list contains more than 8000 elements, so manually define the arrays for the tasks is not feasible. Please check this post for better understading: https://powerusers.microsoft.com/t5/Building-Flows/Email-content-with-multiples-rows-from-a-sharepoi...

Is there any option for classify or filter the tasks by responsable names, to get an output equal to the tasks of each person? If that is posible, then I can use the join function to gather the tasks in simple text. 

Community Support Team
Community Support Team

Re: Sort/join/group rows by columns content

Hi @Joaquinces,

 

No, it is not manually define. It just to get all responsable names store in an array, then use the union() function to process the array to remove duplicate names:

Or you can consider store this email address into the Array instead of name, it will be better way.

Annotation 2019-10-31 142142.png

 

Annotation 2019-10-31 142204.png

 

Annotation 2019-10-31 142227.png

 After that, use the Apply to each to Get corresponding items (tasks) of the user. 

Annotation 2019-10-31 152629.png

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (6,193)