Greetings
Have been trying this for a time now.
I need to tell flows to get all the files in my selected SharePoint Library folder and add them as attachments to an email.
I tried Get File Items and it works but it would sent an email for each file withing the selected SharePoint Library folder. I need to send just one email with all the files as attachments found in the selected SharePoint Library Folder.
Any help would be greatly appreciated
Solved! Go to Solution.
Hi @jaysomrivera,
I have made a test on my side, please refer to screenshot below to create the flow:
The expression in the Condition as below:
@equals(items('Apply_to_each')?['{IsFolder}'], false)
The expression of ContentBytes as below:
body('Get_file_content')?['$Content']
The flow would run successfully as below:
The email would be sent with attachment as below:
You could also refer to link below to learn send an email with multiple attachments:
https://preview.flow.microsoft.com/en-us/blog/multiple-attachments-single-email/
Best regards,
Alice
Hi @jaysomrivera,
I have made a test on my side, please refer to screenshot below to create the flow:
The expression in the Condition as below:
@equals(items('Apply_to_each')?['{IsFolder}'], false)
The expression of ContentBytes as below:
body('Get_file_content')?['$Content']
The flow would run successfully as below:
The email would be sent with attachment as below:
You could also refer to link below to learn send an email with multiple attachments:
https://preview.flow.microsoft.com/en-us/blog/multiple-attachments-single-email/
Best regards,
Alice
Hi,
When I try to replicate this, I receive the error:
InvalidTemplate. Unable to process template language expressions in action 'Append_to_array_variable' inputs at line '1' and column '2015': 'The template language expression 'body('Get_file_content')?['$Content']' cannot be evaluated because property '$Content' cannot be selected. Property selection is not supported on values of type 'String'. Please see https://aka.ms/logicexpressions for usage details.'.
Is there any solution for this?
Best regards,
Ludwig
Hi!
here it is the solution!
You have to modify
body('Get_file_content')?['$Content']
to this:
Hi @v-yuazh-msft .
Thank you you very much for you solution, my flow someway is very similar to this one here but I followed all the steps and I just keep getting one email per attachment, is very confusing for me because I'm not getting any error running the flow. Very appreciatte if someone could help me with this
.
For me, its not working for attachments which are pdf files. I get the error
I rewrote the flow and with below it worked
Hi this looks like a great option, I managed to recreate the flow and it works sending the email with the attachcments (PDF files) but for some reason when i try to open the files it gives me an error message that it cannot open the file "because it is either not a supported file type or because the file has been damaged"
any thoughts on how to solve this please?
thank you
Yes, I faced a similar issue when I began. Can you share your flow and I will compare with mine. You can hide the sensitive and confidential data
Thank you for getting back to me!
For some reason beyond my understanding (i am super new to this) i write it again and it worked! i must have missed something before.
I did another flow similar to it, but to send me the links instead of the files, and it also works, the problem is that it is sending all the links together (separated by comma) and i would like to have them all in separate rows and not a clue how to do that. Any thoughts
@v-yuazh-msft ,
Thank you for your solution, I have been able to replicate this workflow 🙂
Regards
Claire
@AgainOpen ,
Did you get your issue resolved with the PDF Files
when i try to open the files it gives me an error message that it cannot open the file "because it is either not a supported file type or because the file has been damaged"
I have the same issue, and was wondering how to fix it.
Thank you
Claire
Hi Claire.
I changed a couple of things and it worked OK for me.
I keept it all the same up to the "Conditions" - changes are as per images
On the Get FIle content, the "Identifier" comes from "Get file (property only)"
on the Append to Array type in the values
{ "Name": File name with Extension,
"ContentBytes": "File Contetnand File Content
}
File Name with Extension from Get file (property Only) and File Content form the Get file Content
the add the Send eamil and use the attachment section to add the "Apend to array variable"
i just tested it again and it sends me all the PDFs correctly,
Hope it helps
Thank you @AgainOpen
That's how I've built it, but the issue I have is the attachment PDF files are blank 😕
Any idea's why this would happen as the files in the SharePoint library are not blank
Thank you
Claire
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
14 | |
13 | |
12 | |
10 | |
9 |
User | Count |
---|---|
31 | |
24 | |
17 | |
12 | |
12 |