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

Saving email attachments with same name to SharePoint

I have been going slowly mad trying to figure out how to save an attachment to SharePoint from Outlook BUT change the attachment name in the process.  I have a Flow in place that saves the attachment into the correct SharePoint library; however as I use the SUBJECT line from the email as the NAME for the attachment and Attachement Content as the file, I end up with the file in Sharepoint but without a true content type attached to it.  This means that online preview and viewing is not availabe for the saved file.

 

In this particular case, each email will have one attachment, a JPEG.  I'd like to figure out how to get the file into SharePoint as a JPEG but have the actual file name (part before the .jpeg if you will) changed to match the email subject line.  So, if the email subject is CM100 and the jpeg attached the email is something like 2017_000456890.jpeg, I'd like the file in Sharepoint to actually be CM100.jpeg and this is also the default Name in SharePoint.

 

I have tried inserting conditions and have even attempted to use Compose (along these lines) but just don;t know enough about WDL to figure it out.  Any ideas would be greatly appreciated!

 

This is the Flow as it stands:

CMFlow.png

 

Robert (theBeagle)
rMVP (3 time Office Servers & Services MVP, 2014-2016)
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @thebeagle,

 

I just tested with the same flow as yours and got exactly the same result. Then I tried to add ".xlsx" after the subjuct like this:

Capture.PNG

 

After this, the file would show correctly in SharePoint library.

 

Capture.PNG

 

If you make sure that all your attachments are .JPEG format than you just need to add it after the subject. If not, then I'm afraid that this could not be achieved so far. You need to use the "Name(attachment name)" dynamic content instead.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Community Support
Community Support

Hi @thebeagle,

 

I just tested with the same flow as yours and got exactly the same result. Then I tried to add ".xlsx" after the subjuct like this:

Capture.PNG

 

After this, the file would show correctly in SharePoint library.

 

Capture.PNG

 

If you make sure that all your attachments are .JPEG format than you just need to add it after the subject. If not, then I'm afraid that this could not be achieved so far. You need to use the "Name(attachment name)" dynamic content instead.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi, Mona:

 

Thanks!  I was thinking abiout trying something similar.  I'll give it a try and see how it goes.  Many thanks for your response!

Robert (theBeagle)
rMVP (3 time Office Servers & Services MVP, 2014-2016)

As a followup I have implemented this "fix" and can confirm that it works.  I have blogged about the scenario here if anyone cares to check it out:  https://beagledom.ca/2017/08/06/a-tale-of-two-workflows-part-2/

Robert (theBeagle)
rMVP (3 time Office Servers & Services MVP, 2014-2016)

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Top Kudoed Authors
Users online (8,966)