cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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
v-litu-msft
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.

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. 

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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (48,866)