My app has some TextInput fields & a Camera1. Currently it works so long as I take a photo, but if I want to send the email without photo attached I get an error on my phone ....Cannot be Null....
I'd really appreciate any suggestions ?
See Screen3 btnSend OnSelect code below
Office365.SendEmail(TI_Email,HT_Noted3.HtmlText&" - "&TI_Subject,HT_Details.HtmlText&"<br>"&"<br>"&TI_Details&"<br>"&"<br>"&HT_Request.HtmlText&TI_Request,{Importance:Normal,IsHtml:true,Attachments:Table({Name:"Pic1.jpg",ContentBytes:Camera1.Photo,'@odata.type':""})});UpdateContext({cameraEnabled: !cameraEnabled})
Many Thanks
E
Solved! Go to Solution.
Watch these two videos made by Shane Young. They should help you
https://www.youtube.com/watch?v=ycPO7Y3Cyu0&t=1448s
Thanks leyburn19.
I'd already seen Shane's videos but he doesn't explain how to sendemail without an attachment. Somewhere in the Send Button OnSelect property I guess there would have to be an If statement something like If(there is a photo, send email with photo, else send email without photo) but I don't know how to do that.
This is what I've been experimenting with..
Office365.SendEmail(TI_Email,HT_Noted3.HtmlText&" - "&TI_Subject,HT_Details.HtmlText&"<br>"&"<br>"&TI_Details&"<br>"&"<br>"&HT_Request.HtmlText&TI_Request,{Importance:Normal,IsHtml:true,Attachments:Table({Name:"Pic1.jpg",ContentBytes:Camera1.Photo,'@odata.type':""},{Name:"PenInput.jpg",ContentBytes:PenInput.Image,'@odata.type':""})});UpdateContext({BlankImage: PenInput.Image})
Thanks
E
Where do I put the If statement ?
Thanks for your help with this thread @leyburn19!
@Excel_aint are you still getting the error message you described above?
@Anonymous
No. My If statement is about a page long. It's not pretty, but it works.
E
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
185 | |
53 | |
41 | |
36 | |
30 |
User | Count |
---|---|
241 | |
81 | |
71 | |
69 | |
65 |