cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
silverwolf-tan
New Member

Get Password Protected Email Attachment

I created a power automate flow that is triggered when an email arrives in a shared inbox (in Outlook). The flow will get an attachment on the email and create a file in a SharePoint document library that is a copy of that file. I have run into a problem though. Some of the attachments are protected by a password. The way that I know how to do this is to have Power Automate "create a file" in a SharePoint library where the file contents are the same as the contents of the file attached to the email 

  • Is there a way I can give Power Automate the password to the incoming files, so that it can access the contents?
  • Alternatively, is there a way Power Automate can get the file, without opening it, add the (protected and unopened) file to a SharePoint library? (It's not necessary for what I'm doing to actually open the file, just so long as it can be gotten into SharePoint where someone with the password can access it later). 

Or is there any other way I could possibly work around the password?

1 ACCEPTED SOLUTION

Accepted Solutions
manuelstgomes
Community Champion
Community Champion

Hi @silverwolf-tan 

 

You can treat the file like any other file. Power Automate considers it a "bag of bits" that is saved somewhere. Here's a skeleton of what you need.

Screenshot 2020-08-14 at 12.25.41.png

 

You can simply save it and then, the person who tries to open it, has to know the password.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

View solution in original post

3 REPLIES 3
manuelstgomes
Community Champion
Community Champion

Hi @silverwolf-tan 

 

You can treat the file like any other file. Power Automate considers it a "bag of bits" that is saved somewhere. Here's a skeleton of what you need.

Screenshot 2020-08-14 at 12.25.41.png

 

You can simply save it and then, the person who tries to open it, has to know the password.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Thank you for your reply. It is going to be a little while before I can confirm if this works, but you have given me an idea. In the flow that I am using, I had to create an array of attachments and filter out the attachments that were part of the user's signature. I was using the output of the filter command. I think I can arrange it so that I can use the output from Outlook instead, while still filtering. I'm going to try this and see if it works.

So, this solution does work, but I didn't have all the information when I asked my question before, so when I implement this solution, it actually raises a different problem:

 

  • When I asked before, I had missed the fact that the workbook I was trying to save in a document library was an xlsm, so my filter function was filtering it out, since the filter was set to filter out non-xlsx files. I fixed the filter to let xlsm and xlsx files through. 
  • Now I have a new problem. My flow will send .xlsx and .xlsm files to the SharePoint library, but if I attempt to open them (either in SharePoint or in the Excel desktop app, I get an error saying they have the wrong extension and/or are corrupt. 
  • Since this is a new issue, I'll start a new thread, but I'll post the link here just in case it ends up being helpful to someone who has a similar issue and finds this thread. 


Thanks for your answer. 

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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,229)