Hi All,
I have created a Power Automate flow with the trigger (when a file is created property only) that should send an email with the attachments, the flow is running except I have no attachment in the file and I don't have the attachment(s), I don't see where the problem is, if you can help me
Hi @Lovemolecule_9 ,
Here are some things to try:
(1) You can use the Filter Array action to select just the files from the List Folder action (we want to ignore any folders):
(2) Use the Body of the Filter Array action in the Apply to Each loop:
(3) Send an email only if the array variable arrAttachments is not empty:
Ellis
____________________________________
If I have answered your question, please mark the post as ☑️ Solved.
If you like my response, please give it a Thumbs Up.
My Blog Site
Hi again Ellis,
Thanks for your reply,
This is what I made, a quick point, the folder that I put a file to run the flows, is different from the folder that attachment/s are there, because first I need to be sure if the correct file is in the folder.
in summary, place if trigger file is different from places of attachment/s (list folder)
and last part,
I used Cancel to avoid sending more than one mail, because of apply to each, was sending email for each try if I had more than one attachment,
Thanks again,
Have a great day,
Mohammad
Hi @Lovemolecule_9 ,
Sorry, I am having difficulty understanding how the flow is supposed to work.
Can you please show me the details of the When a File is created action, the List folder action and the Get File content action.
For example:
Ellis
____________________________________
If I have answered your question, please mark the post as ☑️ Solved.
If you like my response, please give it a Thumbs Up.
My Blog Site
Hi again Ellis,
Thanks for your quick replies.
Sure, as I need to send emails to more than 40 contractors, do the below actions:
1 - I need to check the files before the email is sent. Therefore I asked Flow to start if I put a file in a separate folder than the place the files are there,
2 - Flow will get file/s inside each folder (there are 40 folders),
3 - Flow check them if they contain specific word/s (Contractor name),
4 - Flow attach the files and send email,
What were the challenges:
1 - Sometimes I had no file/s but Flow was sending email even if there is no attachment,
2 - Follow was sending multiple emails if I had more than one attachment,
Also for your question; Body (get file content by using path) is created when I used "Get file Content and then when I used "Path";
I appreciate your attention and look forward for any suggestion,
Stay safe
Mohammad
Hi @Lovemolecule_9 ,
Can you explain in simple terms what your flow is designed to do, and then how the flow works?
Please also tell me where the Body property is coming from in your flow:
And
Also note that the "When a file is created in a folder (depreciated)" action used in your flow. "(depreciated)" means that this action is no longer recommended for use. Use a recommended replacement action to ensure compatibility and continued support. For example, you could use the When a file is created (properties only):
Ellis
____________________________________
If I have answered your question, please mark the post as ☑️ Solved.
If you like my response, please give it a Thumbs Up.
My Blog Site
Hi Ellis,
Good morning,
Thanks for your reply; please see what I made last,
Somehow, this flow works, but I was forced to use cancel flow, which I believe is not a proper solution; I made some criteria to prevent some mistakes:
1- Flow should send if file name/s doesn't contain the specific word (Company names)
2 - Flow should not send an email if the folder is empty.
Thanks again
Have a nice day,
Mohammad
Please share your flow.
Ellis
____________________________________
If I have answered your question, please mark the post as ☑️ Solved.
If you like my response, please give it a Thumbs Up.
My Blog Site
I added a condition after getting file content; but it is still sending emails if there is no attachment.
Hi Ekarim,
Good afternoon,
I created a Flow like the mentioned one, but due to check the file, I didn't use same folder to send email if there is any new file, I used another folder, my issue is like this:
Flow sends email if there is no attachment, but I don't want the flow to send the email, if there is no attachment, can you give me a solution?
Thanks in advance,
Have a nice day
Mohammad
Hi Ellis,
thanks a lot for your time and your support, it is working perfectly,
Regards
rpersad
16
David_MA
10
Super User 2025 Season 1
Michael E. Gernaey
8
Super User 2025 Season 1