Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

When sending email in power app, I'm unable to capture the text values from the app in email

(0) ShareShare
ReportReport
Posted on by 36

I have a power app that connects to a SharePoint list and Outlook. I've created the app as a blank canvas app. I'm able to save the values from the app back into the SharePoint list. Now, I would like to send an email with those values included. The app sends an email as expected, however, the value from txtPhone.Text is not captured in the email. What am I doing wrong? Below is the code.

 

SubmitForm(Form); Office365Outlook.SendEmailV2( "my email address", "my Subject", "Test: "&txtPhone.Text ); Navigate( ThankYouScreen, ScreenTransition.Fade )

  • StretchFredrik Profile Picture
    StretchFredrik 2,608 on at
    Re: When sending email in power app, I'm unable to capture the text values from the app in email

    You need to replace .ColumnName with your actual name in your datasource that holds the PhoneNumber for example.

    So you could write for example varLastItemSubmitted.Title to get the title of the item.

  • itchel123 Profile Picture
    itchel123 36 on at
    Re: When sending email in power app, I'm unable to capture the text values from the app in email

    When you say, "You can then get the phonenumber using varLastItemSubmitted.ColumnName, does this mean that the code will be like below?

     

    SubmitForm(Form); Office365Outlook.SendEmailV2( "my email address", "my Subject", "Test: "&varLastItemSubmitted.ColumnName); Navigate( ThankYouScreen, ScreenTransition.Fade )

  • StretchFredrik Profile Picture
    StretchFredrik 2,608 on at
    Re: When sending email in power app, I'm unable to capture the text values from the app in email

    Yes, just use varLastItemSubmitted.ColumnName for each of the fields needed 😃

  • itchel123 Profile Picture
    itchel123 36 on at
    Re: When sending email in power app, I'm unable to capture the text values from the app in email

    Thank you.

     

    I have multiple columns that will need to be included in the email.  Would this solution work for multiple fields?

  • StretchFredrik Profile Picture
    StretchFredrik 2,608 on at
    Re: When sending email in power app, I'm unable to capture the text values from the app in email

    StretchFredrik_1-1715618866215.png

     

    You don't need to create the variable, just put it such as the image 😃

    You can then get the phonenumber using varLastItemSubmitted.ColumnName

     

  • itchel123 Profile Picture
    itchel123 36 on at
    Re: When sending email in power app, I'm unable to capture the text values from the app in email

    Hi @StretchFredrik ,

    I'm new to Power Apps so I'm still learning how to navigate the app.  Where is the OnSuccess in my form?  Do I need to create the variable first before setting it?  If so, where?  Is Self.LastSubmit the name of the submit button?

  • StretchFredrik Profile Picture
    StretchFredrik 2,608 on at
    Re: When sending email in power app, I'm unable to capture the text values from the app in email

    Or you can save the last submit in the OnSuccess of your form, such as:

    Set(varLastItemSubmitted, Self.LastSubmit)

  • Verified answer
    StretchFredrik Profile Picture
    StretchFredrik 2,608 on at
    Re: When sending email in power app, I'm unable to capture the text values from the app in email

    The txtPhone.text value will be reset after the "SubmitForm", try sending the email first, and then submitting 😃 

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

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,609

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,420

Leaderboard