Hey everyone, quick intro I am a student at the University of Wisconsin and am currently working an internship where I have been focused on trying to integrate Power Automate into the business. I have found it very interesting and am looking forward to increasing my skills in Power Automate and the other programs in the Power suite.
For this particular flow I am attempting to have it save AP invoices from emails into a SharePoint document library. These invoices may come as an attachment in an email, or they may simply be in the body of the email. My solution is to create a folder in SharePoint that is titled the subject of the email and then save any attachments and save the body of the email within the folder. I ran into an issue where the body of the email is saved as a txt file in SharePoint, but for some reason my computer still cannot open it when I download it from SharePoint; I have to view it in the downloads folder and choose to open it in word in order to view it which is not good enough for this application. (I have checked system defaults to make sure notepad is set to open txt files and that is true but it still does not open unless I open it from Downloads folder)
So, I tried to save the email body to onedrive and convert it to a pdf, but PA currently is unable to convert txt files to any other format.
My next solution was to create a Word template with a field to enter the email body and then utilize the Populate a Microsoft Word template step to make a Word doc containing the email body, and then use the create file in SharePoint step to add this Word doc to the email folder in SharePoint.
Now, I am running into an issue where it says that the flow was successfully ran, but the email body file added in the folder is still the txt file and not a Word doc like it needs to be. I have the Word template saved in SharePoint, and I heard there were some issues with using a template saved in SharePoint so I did the same with the template saved in OneDrive but that changed nothing.
This is the SharePoint folder after a test run, I have no issues creating a folder or saving the attachment but the email body remains a txt file. Again, the flow is ran successfully without any errors it just still shows up saved as a txt file rather than a Word doc which has me confused.
I will put my flow setup here, if anyone has any solutions or other recommendations please let me know!
Hi @nzyck did you check if the "body preview" contains the file extension on the Create File 2? Otherwise, could you please add the .doc extension after the "body preview"
Thank you so much that solved the error of not creating a word document! One issue I still have is it does still enter the body of the email in HTML format like this
Is there any way to fix this so it just enters the text body? Thanks!
I propose another solution.
You can create a SharePoint List with Rich text column for Body Content. Then Using Flow, Create a new List Item and throw body as is in that Rich text. It will look pretty nicely formatted. Then add email attachments as list item attachment.
Now you have everything together in a list which you can search as well.
I made a flow for your solution, and I like it but I am running into an issue where I am unable to open up the saved attachments from the email. I also tested it with an image in the email body, and it saves it as an attachment which is great but I still am unable to open it. Do either of you have any idea why this would happen?
when I click on the attachment
Same issue with the saved image
This is what appears when I click image001.png which is the image in the email body
Just a black screen with that square in the middle, unable to see image.
This is my flow.
I found issues with PDFs. PDF has various versions and with unstable internet, file is corrupted. One of my users in Africa always ended up getting PDF attachment corrupted since she started working remotely and on dial up internet.
Can you try Word attachment and see if that works? So that Issue can be isolated?
Yes, actually my second test I did with a word doc but did not include it in my screenshots. I ran into a similar error, could not open it. This is what shows up after I open it.
I checked your flow. I see that in the File Content Mapping, you have selected Attachments from Outlook. Can you select Attachment Content instead? Should looks something like below...
I changed it to attachments content, and now PDF attachments work but Word documents do not. I get the same error message for Word documents as I did before. PDF attachments do work now with the attachments content method now though.
Check out the announcement of Power Platform content at Microsoft Ignite!
Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.
Features releasing from October 2020 through March 2021