cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Carmen15
Helper IV
Helper IV

Flow that is sending approvals emails only to the in charge peolple for the coresponsing Items?

I have a SP List where the responsible person has to approve his/her coresponsing  details so I need to send him or her an approval email with the coresponsing Items into a CSV file attached. 

 

I want to create a flow that will send approval to the Responsible Person by attaching the coresponsing rows into a cvs file.

For example  'Jack' will receive one single approval email with an attachment where are highlighted the header of the table (the same with the names of the columns in SP List)  and the 20 coresponding rows because his name appears as responsible for 20 Items to approve. 'Mary' will receive on single approval email with a CSV file attached that contains all the 32 rows from the SP List she is responsable with.

 

Is it possible ?

Can someone help me with the indication about how I can do this?

 

Thank you very much!

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Carmen15 

 

I think the below does what you're after?

I added the HTML table just as I could pop it straight into the email so was easier to see. However, if you want to use Approvals in Flow then I think the CSV attachment is the way to go.

 

bradleyhorton_0-1606322570587.png

 

bradleyhorton_1-1606322591425.png

 

It sends two emails, one for items 1 and 2 and one for items 3 and 4 per your list.

 

The union is - 

union(body('Select'),body('Select'))
 
The 'outputs' in the filter array is the output from the compose step above.
 
The CSV Column Values are item()['ID'] (replace with Area/Function)
 
Hope this helps

View solution in original post

12 REPLIES 12
bradleyhorton
Resolver II
Resolver II

I'm not sure if this is the neatest solution but I think I've done something similar just without attaching approval. 

 

Once you have got all items from the SharePoint list create an array that captures the email address of each person who has something to approve so you have a unique list of people.

 

Then use the filter array to narrow down the items you already got for each person in the array. Within the apply to each you can then populate that into a CSV table etc and email.

 

It'll then just run through and do this for each person who has something to approve. 

Carmen15
Helper IV
Helper IV

Hi Bradley , 

Thank you for your reply ! 

 I forget to say that I am a beginner when we talk about Power Automate . So ,I believe I need formulas for creating array and filtering array . Could you please be so kind to provide me an idea about the formulas as well ? 

Thank you very much! 

Carmen 

Hi @Carmen15  Do you have some example/dummy data that I can use?

Also, a screen shot of your flow as it stands would be helpful.

Carmen15
Helper IV
Helper IV

Hi

 

My SP List is look like : 

 

IDFunctionAreaRPL
1FinanceTBRMary
2ITTBRMary
3ITRTPJohn
4FinanceRTPJohn

 

Therefore I need to build an automate that sends one single approval email to each RPL ( Approver name , is Person/Group column in SP) , having into the attachment the csv file where displaying only the rows that correspond to his/her name . For Example , looking to the above table , Mary has to receive an email approval with a CSV file attached where highlighting two rows. 

 

 

I have tried to build the flow as below but it is getting errors 😞 

Not sure what I suppose to do. 

 

Carmen15_0-1606301089313.png

 

Carmen15_1-1606301115766.png

 

For the variables please see below : 

 

Carmen15_2-1606301191603.png

 

Carmen15_3-1606301211612.png

 

Carmen15_4-1606301281040.png

 

Carmen15_5-1606301308233.png

 

 

Hi @Carmen15 

 

I think the below does what you're after?

I added the HTML table just as I could pop it straight into the email so was easier to see. However, if you want to use Approvals in Flow then I think the CSV attachment is the way to go.

 

bradleyhorton_0-1606322570587.png

 

bradleyhorton_1-1606322591425.png

 

It sends two emails, one for items 1 and 2 and one for items 3 and 4 per your list.

 

The union is - 

union(body('Select'),body('Select'))
 
The 'outputs' in the filter array is the output from the compose step above.
 
The CSV Column Values are item()['ID'] (replace with Area/Function)
 
Hope this helps
Carmen15
Helper IV
Helper IV

Hi Bradley ! 

Thank you so much for your effort ; you are absolutely awesome! 

 

Could you please let me know how do I you get the values for Create CSV& Compose 3 as you did? 

I do not have option to select the output from previous Compose only for ID , Function or Area as I noticed on your screen shots. 

 

Carmen15_0-1606373652451.png

 

My option are : 

Carmen15_1-1606373864088.png

 

Carmen15_2-1606373884178.png

 

It might be a silly question and I am sorry for it , but I am still learning about the automate functions. 🙂 

Thank you so much! 

Carmen 

 

Hey @Carmen15  the 'body' should be selectable as an output from the filter array step. 

 

For each column you'll need to click into dynamic content and then expression and type item()['ID'] then replace ID with Area or Function (whatever the names of the columns are. You can see this by looking at the output of the filter array.

Carmen15
Helper IV
Helper IV

I have followed your indications step by step and the results were not as expected . 

The CSV file is keeping only the header but without any details from the SP List with the corresponding Items. 

 

Carmen15_0-1606460748057.png

 

I am attaching here all the details from my flow . Please tell me what I am doing wrong : 

 

Carmen15_1-1606460832988.png

 

For each function : 

 

Carmen15_2-1606460889826.png

Carmen15_3-1606460919011.png

 

 

Carmen15_4-1606460946550.png

Carmen15_5-1606461027150.png

 

 

 

Hi @Carmen15  could you share the results of the filter array step from a previous run please?

Carmen15
Helper IV
Helper IV

Sure , please see below :

 

Carmen15_0-1606461646846.png

 

@Carmen15  so it's this step causing the problem as there is no output. 

 

In the filter array step, change RPL to RPL Email is equal to Outputs. 

 

See how it goes then. 

Carmen15
Helper IV
Helper IV

@bradleyhorton 

 

Thank you so much for all indications! I have successfully run the flow and the results were the expected ones! 

You are awesome! 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (3,707)