cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

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
Highlighted

Hi @Anonymous,

 

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
Highlighted
Community Support
Community Support

Hi @Anonymous,

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.

Highlighted
Anonymous
Not applicable

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. 

Highlighted

Hi @Anonymous,

 

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (10,365)