I have table at sharepoint which consist of manager name , manager email id , market and percentage difference.For example
| Name | Email | Market | Percentage Difference |
| M1 | m1@gmail.com | A | 20% |
| M2 | m2@gmail.com | B | 30% |
| M1 | m1@gmail.com | C | 45% |
| M2 | m2@gmail.com | D | 50% |
| M2 | m2@gmail.com | E | 65% |
now I want to send mail to these manager in the such a way that M1 should get his respective market and percentage difference only in the mail and similarly other managers should only receive market name and percentage difference which belongs to them.For example M1 should get mail in this format
Subject: Inventory Count Difference Alert - <Date>
Body:
Hi M1,
One or more accounts you manage need your attention
- Market: A, 20%
- Market: C, 45%
Please click here to view the dashboard for more details.
Thanks
The Team
Similarly M2 should get market B,D,E in the following format.I have created this flow using following steps :
First as shown above, I have initialize a variable emailbody_part which represents the below part
- Market: A, 20%
- Market: C, 45%
Next I have retrieve items from list using get items.
Next I have retrive Name only from list of values obtained from get items output , use select action for that.

Next below, in Apply to each loop, loop through using below expression which gives unique list of Names obtained from select action output
union(body('Select'),body('Select'))
Inside the loop do the below steps
1. Use filter array to filter only values from values variable which would have Name equal to that of current iterating Name.
2. Now create another loop which will loop through list of rows obtained from filter array and then create the test for merket details and percentage difference.
3. Outside the loop, created in step 2, send an email using emailbody_part variable including in the email body to manager's email id.
4. Reset the value of emailbody_part to null.
see the below screenshots for better idea.



expression:
concat(string(items('Apply_to_each_2')),'. Market: ',body('Filter_array')?[sub(items('Apply_to_each_2'),1)]?['Market'],',',body('Filter_array')?[sub(items('Apply_to_each_2'),1)]?['Percentage Difference'],decodeUriComponent('%0A')).
Now I want to include the option of whether that manager as taken any action for that market or not by adding option for selection as yes or no for each market in the mail and store that response for each market with market name in the sharepoint as separate list.How can I create this flow.Basically I just want to create a feedback whether the concern managers have taken any action for the markets specified in the mail or not. Please suggest any alternative methods or approaches to implement this, if you know of any. Your guidance will be highly appreciated! Thanks in advance for your kind help.