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!
Solved! Go to Solution.
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.
It sends two emails, one for items 1 and 2 and one for items 3 and 4 per your list.
The union is -
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.
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.
Hi
My SP List is look like :
ID | Function | Area | RPL |
1 | Finance | TBR | Mary |
2 | IT | TBR | Mary |
3 | IT | RTP | John |
4 | Finance | RTP | John |
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.
For the variables please see below :
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.
It sends two emails, one for items 1 and 2 and one for items 3 and 4 per your list.
The union is -
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.
My option are :
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.
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.
I am attaching here all the details from my flow . Please tell me what I am doing wrong :
For each function :
Hi @Carmen15 could you share the results of the filter array step from a previous run please?
Sure , please see below :
@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.
Thank you so much for all indications! I have successfully run the flow and the results were the expected ones!
You are awesome!
User | Count |
---|---|
27 | |
16 | |
16 | |
12 | |
11 |
User | Count |
---|---|
42 | |
30 | |
28 | |
24 | |
24 |