cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jschudel
New Member

New Bug: Sending Email with attachment doesn't work in mobile

My app is setup to save an email's attachments to a local collection, and then to attach that collection to a new email sent from PowerApps. (Not through a flow, but through Office365.SendEmail)

 

This works perfectly in a desktop or laptop's browser. And it used to work fine in mobile devices as well. But that's changed the last couple of days. Now, when we try to send that email in mobile, we get an error message that says:

 

Office365.SendEmail failed: { "status": 400, "message": "Parameter 'Attachment Content' cannot be null or empty...

 

Typically, when the attachments are under 1 MB, this error doesn't always occur. When they're over a few MB (ranging from 4-16 MB in our tests), the error usually appears. But again, only in mobile.

 

I can't find any problems that would cause this, since the app does work fine on a desktop. But if anyone has ideas on the cause or how to fix this, please help!

 

We've had a lot more errors appear in our app, especially mobile, over the last couple days than we have over the past few weeks. And we really haven't changed anything! Not sure if it was the most recent PowerApps update or what...

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Hi @Anonymous thanks for your reply. This was helpful but for some reason the error dissappeared. I'm not sure why it worked perfectly, then I recieved that error and it is like it resolved itself. Maybe there was an issue with getting the email address from the backend in the cloud? Not sure but again thanks for taking the time to reply back to me.

View solution in original post

12 REPLIES 12
v-xida-msft
Community Support
Community Support

Hi @jschudel,

 

Could you please share a screenshot of your issue?

 

The error message told that your Attachment Content is null or empty, please check if you have provided proper value for the Attachments property within your Office365.SendEmail(...) formula.

 

I have made a test on my side and don't have the issue that you mentioned. The screenshot as below:2947BD4C-D349-4DCB-B59D-849E719FD4B1.jpg

 

5.JPG

The OnSelect property of the Button control set to following formula:

Office365.SendEmail("Test1@xxxxxx.onmicrosoft.com","Send Iamge","This is atest email",{Attachments:Table({Name:"Test.gif",ContentBytes:AddMediaButton1.Media,'@odata.type':""})})

 

The Attachment is a gif picture whose size is 4.45 MB. The version of PowerApps app wihin my Android Mobile Device (Samsung Galaxy C9 Pro) is 3.18061.12, the version of my Android Mobile Device is 7.1.1.

 

Please provide more details about your app's configuration and the issue, so that, we could reproduce your issue on my side and provide a proper workaround for you.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for your test and response. Here's the main error message:
 
file-5b.jpg
 
 
And here's what my code is doing, specifically (across multiple screens):
 
1) Retrieve all emails with attachments from Outlook inbox, save to local collection:
   ClearCollect(EmailList,Office365.GetEmails({fetchOnlyUnread:false,searchQuery:"hasattachments:yes",top:10}))
 
2) Display that local collection of emails in gallery for user to select one. Set the ID of the email selected to a local variable, MyEmailID:
   Set(MyEmailID,ThisItem.Id)
 
3) Retrieve all attachments from that email, and save to local collection. I have verified that in the desktop version, this does indeed save down the ContentBytes data:
   ClearCollect(AttachmentList,Office365.GetEmail(MyEmailID,{includeAttachments:true}).Attachments)
 
4) Allow the user to remove unneeded attachments from the local collection. If they click the delete button on an attachment in a gallery displaying the collection, this happens: 
   RemoveIf(AttachmentList,Id = ThisItem.Id)
 
5) To send the new email with these attachments, this code is executed as an OnSelect action for a button. It first makes sure the local collection is not empty. If it is empty, it sends an email without attachment:
   If(And(FileSubmission="Email attachment",Not(IsEmpty(AttachmentList))),Office365.SendEmail(SendTo@email.com,"Subject line","Body text",{Cc:CCTo,Bcc:"jschudel@email.com",Attachments:AttachmentList,IsHtml:true}),Office365.SendEmail(SendTo@email.com,"Subject line","Body text",{Cc:CCTo,Bcc:"jschudel@email.com",IsHtml:true}))
 
As I said earlier, on a desktop, this works perfectly. However, on an iPhone, iPad, or Android, I get this error message. I've tested this with multiple attachment sizes. Occasionally, very small attachments work (under 1-2 MB), but anything over 2MB always fails.
 
I'm wondering if the ContentBytes data is not downloading or transferring completely, even though the "loading" seems to complete after step 3 above. Maybe my check in step 5 is not enough? Or not worded correctly? If I could do a check on whether the ContentBytes is empty for any of the items, maybe that would help, but I'm not sure how to do that.

I don't understand, I posted a long reply yesterday with details and it's not showing up here... If it still doesn't appear in a minute, I'll try to repost.

Thanks for your test and response. Here's the original error message:file-5b.jpg

 


This message was from an iPad, but I was also getting the same thing on my Android. We were running PowerApps build 3.18061.12, and my Android version is 4.4.2 (Samsung Galaxy s4 mini).
 
Today, we resaved with the current PowerApps build 3.18062.23. We're seeing the same error on the IPhone/iPad, but the Android throws a different error everytime we try to download or transfer email attachments over 2MB per file. This actually doesn't prevent the email from being sent, just excludes any attachments. (But the iPad/iPhone still won't send the email.) Here is the newest error message from Android:
2018-06-19 23.46.13.png

 

 
 
 
 
And here's what my code is doing, specifically (across multiple screens):
1) Retrieve all emails with attachments from Outlook inbox, save to local collection:
   ClearCollect(EmailList,Office365.GetEmails({fetchOnlyUnread:false,searchQuery:"hasattachments:yes",top:10}))
 
2) Display that local collection of emails in gallery for user to select one. Set the ID of the email selected to a local variable, MyEmailID:
   Set(MyEmailID,ThisItem.Id)
 
3) Retrieve all attachments from that email, and save to local collection. I have verified that in the desktop version, this does indeed save down the ContentBytes data:
   ClearCollect(AttachmentList,Office365.GetEmail(MyEmailID,{includeAttachments:true}).Attachments)
 
4) Allow the user to remove unneeded attachments from the local collection. If they click the delete button on an attachment in a gallery displaying the collection, this happens: 
   RemoveIf(AttachmentList,Id = ThisItem.Id)
 
5) To send the new email with these attachments, this code is executed as an OnSelect action for a button. It first makes sure the local collection is not empty. If it is empty, it sends an email without attachment:
   If(And(FileSubmission="Email attachment",Not(IsEmpty(AttachmentList))),Office365.SendEmail(SendTo@email.com,"Subject line","Body text",{Cc:CCTo,Bcc:"jschudel@email.com",Attachments:AttachmentList,IsHtml:true}),Office365.SendEmail(SendTo@email.com,"Subject line","Body text",{Cc:CCTo,Bcc:"jschudel@email.com",IsHtml:true}))
 
As I said earlier, on a desktop, this works perfectly. It's only on mobile devices, with individual attachment sizes greater than 2MB, where this is an issue. (The total size of all attachments can be greater than 2MB.)
 
I'm wondering if the ContentBytes data is not downloading or transferring completely, even though the "loading" seems to complete after step 3 above. Is there something else I can do?
 
I have tried modifying the steps above by (1) not saving the attachments down to a collection and (2) using the Office365.GetEmail call directly in the Office365.SendEmail call: 
If(And(FileSubmission="Email attachment",Not(IsEmpty(AttachmentList))),Office365.SendEmail(SendTo@email.com,"Subject line","Body text",{Cc:CCTo,Bcc:"jschudel@email.com",Attachments:Office365.GetEmail(MyEmailID,{includeAttachments:true}).Attachments,IsHtml:true}),Office365.SendEmail(SendTo@email.com,"Subject line","Body text",{Cc:CCTo,Bcc:"jschudel@email.com",IsHtml:true}))
 
This basically has the same result, just delays the Android error message until that final step (whereas it appears in step 3 otherwise).
Anonymous
Not applicable

I'm currently having this issue as well, has there been any response or solution yet?

MarinaSE1996
Regular Visitor

Hii!! Have you got the solution? I have the same problem...

Anonymous
Not applicable

Hello,

 

I am using Meeting Capture and I have recieved this error as well today. I got the error in the browser (IE) and as well in Microsoft Teams with Meeting Capture added as a tab in our general channel. I have been digging through Meeting Capture trying to find the specific code that exports attachements to emails. Funny thing is Meeting Capture worked perfectly just a month ago. Is this thread still alive or does anyone from Microsoft have an idea what could cause this issue? Thanks for your time. I attached a screen shot as a reference.

 

Anonymous
Not applicable

Replying to myself but only once I promise (lol). What stands out to me the most in the error message of course is subject cannot be missing or null. I don't see where on the export screens in Meeting Capture it is designating a subject. Wouldn't just take the meeting title as the subject?

Anonymous
Not applicable

Hi @Anonymous thank you for your post! 

 

Take a look at the following thread and let me know if it helps your issue:

 

https://powerusers.microsoft.com/t5/General-Discussion/Where-is-the-code-in-the-meeting-capture-to-send-emails-with/m-p/190185 

 

@Anonymous

Helpful resources

Announcements

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!      

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Community Roundup: A Look Back at Our Last 10 Tuesday Tips

As we continue to grow and learn together, it's important to reflect on the valuable insights we've shared. For today's #TuesdayTip, we're excited to take a moment to look back at the last 10 tips we've shared in case you missed any or want to revisit them. Thanks for your incredible support for this series--we're so glad it was able to help so many of you navigate your community experience!   Getting Started in the Community An overview of everything you need to know about navigating the community on one page!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Ranks and YOU Have you ever wondered how your fellow community members ascend the ranks within our community? We explain everything about ranks and how to achieve points so you can climb up in the rankings! Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Powering Up Your Community Profile Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile. Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Blogs--A Great Place to Start There's so much you'll discover in the Community Blogs, and we hope you'll check them out today!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Unlocking Community Achievements and Earning Badges Across the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. Check out some details on Community badges--and find out more in the detailed link at the end of the article! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Blogging in the Community Interested in blogging? Everything you need to know on writing blogs in our four communities! Get started blogging across the Power Platform communities today! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Subscriptions & Notifications We don't want you to miss a thing in the community! Read all about how to subscribe to sections of our forums and how to setup your notifications! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Getting Started with Private Messages & Macros Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Community User Groups Learn everything about being part of, starting, or leading a User Group in the Power Platform Community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Update Your Community Profile Today! Keep your community profile up to date which is essential for staying connected and engaged with the community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Thank you for being an integral part of our journey.   Here's to many more Tuesday Tips as we pave the way for a brighter, more connected future! As always, watch the News & Announcements for the next set of tips, coming soon!

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Top Solution Authors
Top Kudoed Authors
Users online (2,961)