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

Copy email attachment to Sharepoint Document Library - Conditions are not working

Hi Everyone,

 

I have a flow running which is designed to look at incoming mail from a domain address, with specific words in the subject of the email,  extract the attachement (but only PDF's), and copy the attachment to my Sharepoint Document Library.

 

None of my conditions (from domain, Subject Filter, OR PDF only) seem to be working and the SharePoint library is therefore populated with every attachement from every email I receive which annoyingly includes various png and jpeg files where logos are included in the body of the email.

 

Can anyone help please? I have detailed my setup below:

 

Step 1 - When New Email Arrives (Outlook Connector)

I have pointed to my Inbox

Importance is set to Any

Has Attachment set to Yes

Include Attachments set to Yes

Subject Filter set  to Your Order Acknowledgement

To, CC, To or CC, and From are all not configured.

 

I have then added a condition "From" contains "requireddomain.co.uk"

 

If Yes I have added an "Apply to each" Attachements with my 2nd condition that "Name" contains "pdf". I have left the If No blank.

 

If Yes I have selected Create File. I have populated

  • Site Address
  • Folder Path
  • Filename
  • File Content.

 

I cannot figure out what i am doing wrong, any help provided would be apprecaited. I have screenshots if that would help.

 

Regards,

 

Wayne. 

1 ACCEPTED SOLUTION

Accepted Solutions
McCarron_Wayne
Level: Powered On

Re: Copy email attachment to Sharepoint Document Library - Conditions are not working

Schoolboy error it turns out. I had another rule hidden in team flows which was non specific about the file types of domain address. Once i turned this off it all worked.

View solution in original post

5 REPLIES 5
Community Support Team
Community Support Team

Re: Copy email attachment to Sharepoint Document Library - Conditions are not working

Hi @McCarron_Wayne,

 

It seems that you want to only save pdf files in the SharePoint library. In the Condition, please try to use Name contains .pdf to see if it will work.

 

I have made a simple test on my side and it works fine.

1.PNG

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
McCarron_Wayne
Level: Powered On

Re: Copy email attachment to Sharepoint Document Library - Conditions are not working

Hi Mabel Mao and thanks for your reply.

 

I already have the condition set up in this way but it doesn't work. Please see a screenshot of my flow, can you see any obvious errors?

 

Capture.PNG

 

Thanks Again.

 

Wayne.

Community Support Team
Community Support Team

Re: Copy email attachment to Sharepoint Document Library - Conditions are not working

Hi @McCarron_Wayne,

 

Can the flow be triggered?

 

What’s the error message it returned?

 

Could you try to add an Office 365 Outlook action Get attachment before the action Create file?

 

I have made a simple test likes below, and it works fine saving only PDFs to the SharePoint library.

1.PNG

 

Besides, it seems that you want to trigger a flow based on the sender’s email address, this doc on triggering a flow based on email properties could be your reference:

https://docs.microsoft.com/en-us/flow/email-triggers

 

Please try again with it on your side and feel free reply if you need more help.

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
McCarron_Wayne
Level: Powered On

Re: Copy email attachment to Sharepoint Document Library - Conditions are not working

Hi.

 

I have tried adding in the extra step as suggested. There are no error messages as it runs successfully every time, the problem is it fires on all incoming emails regardless of where they are coming from and brings in every attachment including .png .jpg and .img files where logos/pictures are included in the email.

 

The Requirements should be:

 

1. Email recieved from specific domain (Eg: Microsoft.co.uk)

2. Email Subject Contains the word Acknowledgement)

3. Bring in attachements that contain .pdf in their name.

 

I have just tested by sending myself an email with an excel attachment. Despite filling none of the criteria as described above the excel document has appeared in teh document library along with 6 .png files.

 

Regards,

 

Wayne.

 

 

 

McCarron_Wayne
Level: Powered On

Re: Copy email attachment to Sharepoint Document Library - Conditions are not working

Schoolboy error it turns out. I had another rule hidden in team flows which was non specific about the file types of domain address. Once i turned this off it all worked.

View solution in original post

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 187 members 4,527 guests
Please welcome our newest community members: