Power Automate Exchange

Please login or click SIGN UP FOR FREE to create your FlowUG account to join this user group.
  • 1.  Problems sending attachments from SharePoint list in an email: (1) attachments are corrupt; and (2) sends multiple emails based on number of attachments

    Posted Aug 30, 2021 04:14 PM
    I am really stuck on this one. Been trying "solutions" from Google searches for about six hours.

    Scenario:

    I have a Power App that's connected to a SharePoint list. Each list item includes one or more attachments. I have a button in the Power App that launches a Flow. The Flow sends an email with content from one of the SharePoint list fields in the email body and the attachments from the SharePoint list item.

    The Flow sends the email with the attachment(s). However:

    1. The attachments won't open - says they are corrupted. Tested Excel, Word, and PDF files.
    2. Sends as many emails as there are attachments. For example, if there are three attachments, it sends three identical emails.
    Images of Flow attached.

    I've seen references to content-type vs content and base64ToBinary expression. But I can't figure out which Flow step these would go in.

    Sigh.


    ------------------------------
    Lisa White
    Senior IT Specialist
    Herndon VA
    703-709-7172
    ------------------------------


  • 2.  RE: Problems sending attachments from SharePoint list in an email: (1) attachments are corrupt; and (2) sends multiple emails based on number of attachments

    Microsoft Power Platform Team
    Posted Aug 31, 2021 01:16 AM
    Hello Lisa,

    There are 2 things you to double check.  In the this link, a user had a similar issue.  The solution was changing ensuring the "ContentBytes" in the Value property of the "Append to Array" action to be this:

    "ContentBytes""@body('Get_attachment_content').$content"

    You can check this by clicking the Elipses (...) in the top right corner of the action, and clicking on "Peek Code".  If it doesn't have that, then remove the dynamic holder, put your cursor between the quotations marks, click on expression and paste in the following with out the @ :

    body('Get_attachment_content').$content

    Then click "Ok".

    As far as your email, ensure your "Body" field is referencing the trigger action for the "RequestorComments", and not the "Get Attachments" action.  The action you want to use for the Body is the same action you use to supply the "Id" field in the "Get Attachments" action, so it would be above that action.  "RequestorComments" on the action above should be a string, and a single record, not an array of records.

    Please let me know if this helps.


    ------------------------------
    Nick Miller
    Premier Field Engineer
    Power Platform & SharePoint
    ------------------------------



  • 3.  RE: Problems sending attachments from SharePoint list in an email: (1) attachments are corrupt; and (2) sends multiple emails based on number of attachments

    Posted Sep 03, 2021 01:35 PM
    Hi Nick,

    Thanks for the suggestion. I followed the steps.

    The problem isn't that the Flow doesn't get multiple attachments. It's that when I try to view/open attachment in the resulting email, it says the files are corrupted and it's sending three emails (or however many attachments there are).



    ------------------------------
    Lisa White
    Senior IT Specialist
    Herndon VA
    703-709-7172
    ------------------------------



  • 4.  RE: Problems sending attachments from SharePoint list in an email: (1) attachments are corrupt; and (2) sends multiple emails based on number of attachments

    Top Contributor
    Posted Aug 31, 2021 07:07 AM
    Try this video from Shane Young. It does not rely on a Flow, it is all internal to the PowerApp.

    ------------------------------
    Brian Scott
    Chief Creative Officer
    Concord NC
    ------------------------------



  • 5.  RE: Problems sending attachments from SharePoint list in an email: (1) attachments are corrupt; and (2) sends multiple emails based on number of attachments

    Posted Sep 03, 2021 01:40 PM
    Thanks, Brian. This is what finally worked for me, with a few tweaks to some field values (using Updates instead of LastSubmit):



    ------------------------------
    Lisa White
    Senior IT Specialist
    Herndon VA
    703-709-7172
    ------------------------------