cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

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
Highlighted
Community Support
Community Support

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

7 REPLIES 7
Highlighted
Community Support
Community Support

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

Highlighted
New Member

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.

Highlighted
New Member

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.

Highlighted
New Member

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

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

Highlighted
New Member

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

have same problem

Highlighted
Frequent Visitor

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

Highlighted
Helper V
Helper V

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

Same problem here.

 

Ended having more work building flows than to manually save the files in OneDrive.

 

Anyway, I tried the @NHes expression:

 

@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'))

 

But it returns:
"Invalid expression".

 

Anotação 2020-03-31 145448.png

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

Users online (7,532)