cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thewiteam
Level: Powered On

How to save only certain attachments from outlook to onedrive

I am currently using the pre-made flow that saves attachments from emails to onedrive for business, but I cannot figure out how to get specific file extensions to save to this folder.  I would like to get .pdf, .doc, and .docx to save there but can only get one or the other. 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to save only certain attachments from outlook to onedrive

Hi @thewiteam,

 

Could you please share a bit more about your scenario?

What do you want to do with the specific file extensions?

Do you want to save the attachments which contain .pdf, .doc or .docx file extensions to a OneDrive for Business folder?

 

I have made a test on my side (Create flow with the "Save Office 365 email attachments to OneDrive for Business" built-in template) and please take a try with the following workaround:10.JPG

Within Condition box, type the following formula:

@or(contains(items('Apply_to_each_Attachment_on_the_email')?['Name'], '.pdf'),contains(items('Apply_to_each_Attachment_on_the_email')?['Name'], '.doc'),contains(items('Apply_to_each_Attachment_on_the_email')?['Name'], '.docx'))

The flow works successfully as below:11.JPG

 

 

If I understand incorrectly, please let me know here, I would provide a proper solution for you.

 

Best regards,

Kris

 

 

 

Community Support Team _ Kris Dai
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

6 REPLIES 6
Community Support Team
Community Support Team

Re: How to save only certain attachments from outlook to onedrive

Hi @thewiteam,

 

Could you please share a bit more about your scenario?

What do you want to do with the specific file extensions?

Do you want to save the attachments which contain .pdf, .doc or .docx file extensions to a OneDrive for Business folder?

 

I have made a test on my side (Create flow with the "Save Office 365 email attachments to OneDrive for Business" built-in template) and please take a try with the following workaround:10.JPG

Within Condition box, type the following formula:

@or(contains(items('Apply_to_each_Attachment_on_the_email')?['Name'], '.pdf'),contains(items('Apply_to_each_Attachment_on_the_email')?['Name'], '.doc'),contains(items('Apply_to_each_Attachment_on_the_email')?['Name'], '.docx'))

The flow works successfully as below:11.JPG

 

 

If I understand incorrectly, please let me know here, I would provide a proper solution for you.

 

Best regards,

Kris

 

 

 

Community Support Team _ Kris Dai
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

MR18
Level: Power Up

Re: How to save only certain attachments from outlook to onedrive

Hello,

I have a specific attachment I don't want saved: it's called "PastedGraphic-1.tiff" and it comes with every single email from a particular sender. Do you know how to create a rule that it excludes that particular attachement?

Thanks,

M.

UXadmin
Level: Power Up

Re: How to save only certain attachments from outlook to onedrive

SUggested script did not filter out PNGs. Useless unless graphics in senders' signatures are not excluded. This should only route document types that users actually save.

rsborgesKF
Level: Power Up

Re: How to save only certain attachments from outlook to onedrive

Is there anyway to save everything but image files (png, jpg, etc)?

Putridum
Level: Power Up

Re: How to save only certain attachments from outlook to onedrive

have same problem

Highlighted
NHes
Level: Powered On

Re: How to save only certain attachments from outlook to onedrive

The sugested solutions woks in the 'run details'. However it still goes and stores/uploads png files even though the attachments are seen as 'false' to the condition. ie The run conditions demonstrate no action to be taken on false conditions, however still the png files are stored in One Drives.

NewExpression insert.PNGTrueRun.PNGHoweverAllFilesGetUploaded.PNGFalseShouldDoNothing.PNG

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (5,346)