SOLVED

Flow to extract attachments from Inbox

Brass Contributor

Hi

 

We have a Outlook Inbox that has a subfolder in this that contains lots of emails with attachments on them.

 

We want to be able to extract the attachment from these emails and save them into a folder.

 

We believe we can do this for new emails coming into the inbox using flow but anyone know if its possible to run flow or something else to extract the attachments that are already sitting in the email folder?

 

Thanks

17 Replies
A couple of quick ideas / options:

1 - Create another new folder under Inbox, configure the Flow to run against that new folder, then move all the existing emails to the new folder - so the Flow triggers on them.

2 - Create a Flow that is triggered manually (or on a schedule), and points at the folder - this Flow would need to have steps something like this:

- Get items in folder that have attachments
- For each, get the attachment and save it

Thanks @Rob Ellis

 

I have been setting up your ideas, however it doesn't seam work.

 

What seams to happen is that if I manually copy 1 email into the subfolder and then MANUALLY run the flow it will copy the attachment to a sharepoint or onedrive site

 

However if I copy 2 or 3 email it and then manually run it will only copy the attachment from the "newest" email, it will ignore the other emails.

 

It NEVER run automatically. 

 

Attached are screen shots of what I have done - any ideas on how to get this working would be appreciated.

 

tempsnip.pngtempsnip2.PNG 

@Pn1995 It is likely that the trigger does not occur when you move an existing email into the folder - try configuring an Outlook rule to move messages into that folder when received, then send a test email.

 

For dealing with existing emails in the folder, my 2nd option would be the one to go for, I think.

 

That would need to be triggered manually or on a schedule, and use the action 'get emails' (not 'get email' - because you want more than 1)

@Rob Ellis 

 

Thanks again Rob

 

I tried to get emails but it still seams to do the same thing. When I manually trigger (I guess you mean just press Test) it only ever seams to look at 1 email in the folder not all of the,

 

This is my setup...any other suggestions would be appreciated

 

Capture.PNGtempsnip2.png

@Pn1995 

I'm not using a shared mailbox, I'm testing with my user mailbox, so the trigger I have is 'when an email is received' - but using the action as per below, if I move an unread email or a read email from another folder into the 'Processed' folder - the flow triggers and saves out the attachment every time:

 

2019-04-12_13-02-04.png

 

so in theory that would work if you created a new folder and had that flow trigger on the new folder, then moved emails from another folder into the new folder.

 

I'll give it a go using a shared mailbox - BRB.

Thanks @Rob Ellis, I guess the main issue we are having is that it doesn't seam to trigger if more than 1 email is moved - ie if we move or copy 3, 4 or 5 emails it only every processes the "newest" one of those mails.

 

and we can't seam to get it to look at a existing mailbox that has the 2000 attachments in there and process more than 1 of those

Thanks @Rob Ellis 

 

I guess the main issue is that it needs to trigger if we copy or move more than 1 email at a time in there and it doesn't seam to do that. It only every saves the attachment of the latest email, So if you copy day 5 mails into the folder only mail 1 will have its attachment saved

 

The folder we want to process the attachment in has 2000 emails, and we can't seam to get it to analyse this folder and extract from there

@Pn1995 I can see that issue, agreed - it only triggers on the most recent email - including if using an Outlook rule to move the emails into the folder.

 

Using a manually triggered flow like this will do what you need

 

(Note I have mine set to only get unread emails, and limit to 10 - so you will need to increase that):

2019-04-12_14-04-45.png

Thanks again @Rob Ellis 

 

So just to confirm in order for it to "process" more than 1 email you are suggesting that I need to created a "Apply to each" action - so if I want to process 10 emails create 10 "Apply to each"

 

Also in the "Get Email" "Top" field were you have 10, isn't there a limit of 25 to that?

best response confirmed by Pn1995 (Brass Contributor)
Solution
No - the 'apply to each' required are automatically added by Flow when it detects that you are using an output that is an array - e.g. if you use an output from 'get emails' (rather than get email) - the action is automatically put inside a 'apply to each'.

Basically, you Flow would need to look almost identical to mine, in terms of blocks, at least.

Regarding the limit on number of emails it will get - I'm not sure, but it would be easy to test.

If you do find there is a limit, you may need to move batches of emails into a folder, and run the Flow multiple times.

Thanks @Rob Ellis

 

There is a 25 checking limit - which is very annoying but the flow does work - cheers 

@Pn1995 

 

We can use  Instant Flow --> When an email is flagged --> Save attachment  to One Drive folder.

 

After creating flow select all mails and add flag then the flow will run:smile:

 

I Did this one for 1500 mails 

 

Lakshman_Kanth_0-1581088812931.png

 

Thanks ,

LK

@Lakshman_Kanth this is genius!  Simple and effective.  Thanks!

I am new to this process, can you help me set up the flow step by step?

I like this flow and already using it but I need to have something more specific. 
I want to extract the attachment but only certain files , like pdf file. I don't want images to get into my folder.

Any idea on how to do that ?

@j_cabanillas 

 

I just posted a thread on a similar topic.   

I want to extract 1 particular attachment from a received email, and save it to Sharepoint.   Easy enough with pre-built flows by MSFT, except the "apply to each" piece that kicks in automatically during the build.    Signature lines contain lots of png and jpeg files as attachments that get saved due to "apply to each" and I need a way to identify and pull only the file in word or excel as the attachment, skipping the others from sig line.     any takers on helping with how to do this?

If you are looking for a solution to extract attachments from Outlook Inbox then should try the ToolsBaer Outlook Attachment Extractor Tool it can instantly work to extract all data from Outlook Inbox has a subfolder that contains lots of emails with attachments this tool can work with it as well. this software is helpful to helpful for flow to extract attachments from Inbox and it can easily extract emails, contacts, calendars, and attachment files. This is a simple solution to extract Outlook attachments from Outlook for non-technical users. This safe solution helps to download attachments from multiple Outlook PST and OST files at a single time. It also enables users to gather attachments from heavy PST files without any conversion of original content. This is the simplest solution that supports Windows all versions of operating systems. Download the free demo version to examine its features.

1 best response

Accepted Solutions
best response confirmed by Pn1995 (Brass Contributor)
Solution
No - the 'apply to each' required are automatically added by Flow when it detects that you are using an output that is an array - e.g. if you use an output from 'get emails' (rather than get email) - the action is automatically put inside a 'apply to each'.

Basically, you Flow would need to look almost identical to mine, in terms of blocks, at least.

Regarding the limit on number of emails it will get - I'm not sure, but it would be easy to test.

If you do find there is a limit, you may need to move batches of emails into a folder, and run the Flow multiple times.

View solution in original post