I am having an issue with Powerapps. I need to send an email with out outlook 365. So I am using the Launch fuction which works fine if put a hard email in the code but does not work if I try to use a variable from a field. As you can see it does not like the ThisItem.Email value. I can make it use just "Email" but then I get giberish in my To:field in outlook. The email data is Generated by a default value of Text(user().email). Yes I am trying to get the app to email the information in the form back to the person that just created the record. We have to copy the information into a program that is not compatable with powerapps or have a phone app capability. I have quite a bit of experiance in ACCESS but this is new to me so any help would be great.
What's the error message that you see when you hover your mouse over the underlined value ThisItem.Email?
ThisItem is valid only in the context of a form or card. I suspect that you've added this formula to a button or control that is not within a card, and this is the reason why you see this error.
Well that explains it. I have that added to the submit button in the action bar at the top of the screen. I don't guess there is anyway to make this work? I was trying to keep it simple with only one button doing two functions.
Ok put a button in the form and fixed that problem. Now is there a way to put line break in the body between each thisitem value?
With regard to placing the button in the header, if you want to add the button in a display form, you can reference the data item that your form is set to. The syntax would be something like this:
What exactly do you mean by put a line break in the body between each thisitem value? Do you want to place line breaks in your formula, or do you want to place line breaks in the text that you're constructing for the body argument of your call to mailto? If it's the former, <shift><enter> will add a line break to the formula. For the latter, here's the formula for the escape sequence that gives you a carriage return/line feed.
Char(13) & Char(10)
Here is what I have. Remember I am using an exchange server so have to use launch (mailto: with the below code. What I need is line break between each field. Everything is working but it is coming out as one long string instead of how it is displayed in the code. The other issue I have to address is that ios and android are both dumping all of the information in the TO: field in the emails.
Launch("mailto:"& ThisItem.Creator_x0020_Email & "&subject=Recent site visit report.&body=" &" Date: "& ThisItem.Date &" Customer: " & ThisItem.Customer_x0020_Name &" Purpose of visit: "& ThisItem.Purpose_x0020_of_x0020_Visit &" Issues: "& ThisItem.Issues &" Notes: "& ThisItem.Notes)
For Exchange/Outlook, you can use the URL escape sequence for a line break - %0A
Launch("mailto:"& ThisItem.Creator_x0020_Email & " &subject=Recent site visit report.&body=" &" Date: "& ThisItem.Date & "%0A" & &" Customer: " & ThisItem.Customer_x0020_Name & "%0A" & &" Purpose of visit: "& ThisItem.Purpose_x0020_of_x0020_Visit & "%0A" & &" Issues: "& ThisItem.Issues & "%0A" & &" Notes: "& ThisItem.Notes)
I don't know what the answer is to IOS/Android not separating the Subject and Body values. Hopefully, someone else here will know the answer.
Well that worked for the line breaks but the other issue is happening now in outlook as well so i must have made a mistake in the code.
I'd try substituting the spaces in your data items with the escape code for a space, %20
I'd use this syntax that looks like this in all the places that could contain spaces....
&" Customer: " & Substitute(ThisItem.Customer_x0020_Name," ", "%20") & "%0A" &
Check out the News & Announcements to learn more.
Did you know that you can visit the Power Query Forum in Power BI and now Power Apps
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.
DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.