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 / Need help with Launch ...
Power Apps
Unanswered

Need help with Launch (Mailto:

(1) ShareShare
ReportReport
Posted on by 18

 

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.  

 

 

powerapp.PNG

Categories:
  • timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    Hi @Jachord

     

    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.

  • Jachord Profile Picture
    18 on at

    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.

  • Jachord Profile Picture
    18 on at

    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?

  • timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    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:

     

    BrowseGallery1.Selected.Email

    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)
  • Jachord Profile Picture
    18 on at

    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)
  • timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    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.

  • Jachord Profile Picture
    18 on at

    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.

  • Jachord Profile Picture
    18 on at

     Ok I changed the & in front of subject to ? and now it populates correctly but puts a + in place of spaces.  

  • timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    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" &

     

  • Jachord Profile Picture
    18 on at

    Thanks, I tried it with no luck.

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard