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
Super User II
Super User II

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
Super User II
Super User II

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

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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,077)