Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Issues triggering emails with attachments from shared mailbox


View products that this article applies to.

Symptoms

In PowerAutomate, when a flow has "When a new email arrives in a shared mailbox (V2)" trigger, for example, you notice any of the following:

  • The flow is not triggering for all the emails that come into the mailbox
  • The flow is not triggering for emails with attachments
  • You get a 400 Bad Request or similar error in actions that use the trigger output attachment content bytes

 

↑ Back to the top


Cause

By default, the trigger will have the following attachment-related options set to "No".  This is because triggering on all mails doesn't miss any (you might want to trigger on emails without attachments too) and attachments can be large in size:

  • "Only with Attachments"
    • If set to "No", it will trigger on all emails.  If "Yes", it will trigger on emails with attachments.  Use the latter if your flow only needs to trigger on mails with attachments; otherwise, keep it set to "No".
  • "Include Attachments"
    • If set to "No", it will not include the attachments content (it will be set to null).
    • For example, if set to "No" and you have a Sharepoint "Create File" action that uses the null attachment content, then this will result in "400 Bad Request" errors because the file content would be null, or empty, which is invalid.
    • If set to "Yes", it will include the attachment content bytes instead of being null and Sharepoint "Create File" action, for example, will succeed and the file created will contain the attachment content.

 

Note:  These are the default option values for the trigger output because attachments can be large in size.

↑ Back to the top


Resolution

To make the flow trigger also on emails that have attachments and to make the attachment content available to other actions (i.e. not to set contentBytes to null), in the trigger card:

  1. Expand "Show Advanced Options" by clicking on it
  2. Set "hasAttachments" to true
  3. Set "includeAttachments" to true

See associated screenshots for the above steps

Expand the "Show Advanced Options" by clicking on it:

[Asset 4563987]

Set "Include Attachments" to "Yes" to make the content available to other Power Automate actions.

Set "Only with attachments" to make the flow trigger only on emails with attachments.

[Asset 4563985]

↑ Back to the top


Keywords: power automate, shared mailbox, mailbox, mail, email, trigger, triggering, shared, when a new email arrives in a shared mailbox, attachment, attachments, include attachments, include, 400, bad request, bad, request, sharepoint, create file, create, file, content, bytes, content bytes, flow, flows, only with attachments

↑ Back to the top

Article Info
Article ID : 4563989
Revision : 5
Created on : 5/22/2020
Published on : 5/22/2020
Exists online : False
Views : 120