Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Attachment control / Office365Outlook.SendEmailV2

(0) ShareShare
ReportReport
Posted on by 56

Hi All,

 

I'm having a slight issue in trying to incorporate a file attachment into the email notification that's sent when a form is submitted within my Power App.

The app itself is pretty basic -

 

  • Edit Form named formReq ; data source is a SharePoint list named "Requests".
  • Default Mode: New
  • Form includes a description field and an attachment control named attchItem. The Data Card containing the attachment control is linked to the "Attachments" field on the SharePoint list.
  • Icon in the upper-right corner of the screen contains SubmitForm(formReq) in the OnSelect behavior.
  • OnSuccess behavior of the form incorporates the Office365Outlook.SendEmailV2 functionality.

 

Upon submitting the form, I can see (and view/download) the attached file on the SharePoint item that's created - represented by the paperclip icon underneath the "Attachments" column. Thus, it's submitting properly, but for some reason, the attachment is not included in the e-mail notification that's sent out when the form is submitted; everything else (i.e.: subject line, body, cc) works as expected. Below is the code I'm currently using within the OnSuccess behavior of formReq:

 

Notify("Success", NotificationType.Success);
Office365Outlook.SendEmailV2
(
"myemailaddress@mydomain.com",
"New Request Submitted!",
"<p style='font-size:20px'>
<b>Request # " & formReq.LastSubmit.ID & "</a> has been submitted!</b></p>
<ul><li><p style='font-size:16px'><b>Description:</b> " &
formReq.LastSubmit.Description &
"</p></li><li><p style='font-size:16px'><b>Submitted By:</b>" &
formReq.LastSubmit.Submitted_x0020_By & "</li></ul>",
{
Cc:"teamdistro@mydomain.com",
Attachments: AddColumns(RenameColumns(attchItem.Attachments, "Value", "ContentBytes"), "@odata.type", "")
}
);
Navigate(screenReqListing);

 

Any thoughts as to why the attachment is missing from the email notification? 😕

Categories:
  • nguyenhai Profile Picture
    14 on at
    Re: Attachment control / Office365Outlook.SendEmailV2

    Matthew Devaney have the solutions to this on website @ https://www.matthewdevaney.com/power-apps-send-email-using-outlook-the-complete-guide/

    Office365Outlook.SendEmailV2(
     txt_EmailTo.Text,
     txt_Subject.Text,
     txt_Body.Text,
     {
     Attachments: ForAll(
     att_Attachments.Attachments,
     {
     ContentBytes: Value,
     Name: Name
     }
     )
     }
    );

      

  • CNT Profile Picture
    10,919 Super User 2025 Season 1 on at
    Re: Attachment control / Office365Outlook.SendEmailV2

    @bcanfield83 Glad to help! 😊

  • bcanfield83 Profile Picture
    56 on at
    Re: Attachment control / Office365Outlook.SendEmailV2

    @CNT  Thanks! 

  • Verified answer
    CNT Profile Picture
    10,919 Super User 2025 Season 1 on at
    Re: Attachment control / Office365Outlook.SendEmailV2

    @bcanfield83 Looks like this is an issue others are also facing (Send email with existing attachment from attac... - Power Platform Community (microsoft.com)) . Please consider raising a ticket with MS.

  • bcanfield83 Profile Picture
    56 on at
    Re: Attachment control / Office365Outlook.SendEmailV2

    @CNT Agreed, it's vexing me! 😕  I'll give that a try - thanks! 

  • CNT Profile Picture
    10,919 Super User 2025 Season 1 on at
    Re: Attachment control / Office365Outlook.SendEmailV2

    @bcanfield83 It's a bit strange why it's not working. Remove and re-add that Attachment field and don't unlock that data card and try and see if it works.

  • bcanfield83 Profile Picture
    56 on at
    Re: Attachment control / Office365Outlook.SendEmailV2

    @CNT Yea the data source for the form is "Requests" which is the name of the SharePoint list. The DataField for the Data Card that contains the attachment control is "{Attachments}" which is one of the columns on the SharePoint list. 

  • CNT Profile Picture
    10,919 Super User 2025 Season 1 on at
    Re: Attachment control / Office365Outlook.SendEmailV2

    @bcanfield83  In your case the contents says, appres://blobmanager/ which means that this control is not really linked to your SP list. If it was linked to your SP list, the contents would be something like, appres://datasources/yourSPList/table/...... 
    What is the Datasource for the Form which holds this control? Is it pointing to u'r SP list?

  • bcanfield83 Profile Picture
    56 on at
    Re: Attachment control / Office365Outlook.SendEmailV2

    Hmm, yep it looks like it does (see screen print).. does that look right? 

  • CNT Profile Picture
    10,919 Super User 2025 Season 1 on at
    Re: Attachment control / Office365Outlook.SendEmailV2

    @bcanfield83  It's a bit strange, anyway can you highlight this bit of the code AddColumns(RenameColumns(attchItem.Attachments, "Value", "ContentBytes"), "@odata.type", "") in the formula bar and see if ContentBytes has the contents in it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard