web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error on sending email...
Power Apps
Unanswered

Error on sending email - Parameter 'attachment content' cannot be null or empty

(0) ShareShare
ReportReport
Posted on by 105

Hi all,

I'm having trouble sending emails with multiple attachments through my app.

The error encountered is the following:

error.png

The OnSelect property of my send icon is:

Office365Outlook.SendEmailV2(
 txtDestinatari.Text;
 txtOggetto.Text;
 txtCorpoMailAirFlash;
 {
 Importance: "Normal";
 Cc: txtCopiaConoscenza.Text;
 Bcc: txtCopiaConoscenzaNascosta.Text;
 Attachments: RenameColumns(
 AllegatiMailAir.Attachments;
 "Value";
 "ContentBytes"
 )
 }
);;
Reset(txtCopiaConoscenza);;
Reset(txtDestinatari);;
Reset(txtOggetto);;
Reset(txtCopiaConoscenzaNascosta);;
Back();;
Notify(
 "Richiesta inviata con successo!";
 NotificationType.Success;;
 3000
)

I state that the attachments are correctly imported into the mail sending screen. (see screenshot below)

roby9390_0-1669624311940.png

 

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @roby9390 ,

     

    Could you please share more details about your scenario? I tried to reproduce this issue but failed. How large are the two PDF files? Have you tried to use small jpg files and test?

     

    Best regards,

  • roby9390 Profile Picture
    105 on at

    @v-jefferni  Thank you for your reply.

    The PDF files are large respectively 13Kb and 21Kb.

    I think it's not size the issue.

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @roby9390 ,

     

    Sorry but I still cannot reproduce this error. Could you please double check the outputs of the table below, by selecting this whole function in the formula bar after files have been uploaded?

    RenameColumns(
     AllegatiMailAir.Attachments;
     "Value";
     "ContentBytes"
     )

     

    So, if you have uploaded two files, there should be two records return by this function, and no blank contentBytes column value be there.

     

    Best regards,

  • roby9390 Profile Picture
    105 on at

    Hi @v-jefferni 

    here below the screenshot where you can see that the 2 records appear correctly in the table.

    Cattura.JPG

     

    But I think I have omitted something quite important: my Items property of my attachment control is setting as follow:

    varRecord.attachments

    varRecord is set by pressing an icon contained in a gallery which has the following properties:

    Set(varRecord;ThisItem);;Navigate(Schermo_MailAereaFlash;Fade)

    In the mail sending screen, the attachments are correctly shown in the appropriate control but it generates the error as if the control were empty. If I delete the automatically uploaded attachments and reload them manually directly from the attachment control on the send mail screen, the problem does not occur and the mail is sent correctly.

     

    Let me know if I wasn't clear on anything.

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @roby9390 ,

     

    You can see that the content bytes will contain values from different formats, as distinct from getting saved files in SharePoint lists and manually uploading files:

    vjefferni_0-1669972853189.png

     

    If you will only send emails with files saved in SharePoint list Attachments column, you need to leverage a flow the get the files from specific list, by passing the selected item ID from PowerApps to Power Automate, then use "Get items" action with filter query set to ID eq "Ask in PowerApps" dynamic content. Next, you can "Get attachments" from that item and get attachment contents, send Email with , as in below blog:

    Power Automate send an email with an attachment from SharePoint - EnjoySharePoint

     

    Also, you can reference below video:

    www.youtube.com

     

    Best regards,

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 305 Most Valuable Professional

#2
11manish Profile Picture

11manish 212

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard