web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Unable to display user...
Power Apps
Answered

Unable to display user input in the email notification

(0) ShareShare
ReportReport
Posted on by

I am using SharePoint list for the Office 365 connection to sending a confirmation email to the user once a new request is submitted. 

Email works fine but unable to display the entries to the email body.

 

If(
!Form1.Valid, SubmitForm(Form1),
SubmitForm(Form1);
Navigate('Thank you');
Notify(
"Submitted new record.",
NotificationType.Success
),
Office365.SendEmail(
User().Email,
"Intake Form - Submission Confirmation : " & DataCardValue1.Text,
"Hi <b></b>" & Left(
User().FullName,
Find(
" ",
User().FullName
) - 1
) & "," & " <br><br>
Thank you for your submission." & "<br><br><b></b>" & "We will review and respond no later than two (2) business days. <br><b> <b></b></b>" & " <br> Please feel free to reach out to @abc@XYZ.com if you have any questions.<b></b><br>" & "<br>Thanks!" & "<br><br><br><br><br><br>-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" & "<br><b><br>Project Name : </b>" & DataCardValue1.Text & "<br><b><br>PR # </b>: " & DataCardValue3.Text & "<br><b><br>Business Group : </b>" & DataCardValue12.Text & "<br><b><br>Third Party Supplier : </b>" & DataCardValue7.Text & "<br><b><br>Brief Description : </b>" & DataCardValue8.Text & "<br><b><br>Notes : </b>" & DataCardValue10.Text & "<b></b><br>",
{
IsHtml: true,
Importance: "Normal",
Cc: "SP@XYZ.com"
}
)
);

Categories:
I have the same question (0)
  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    This is happening because once the form is submitted, the data is wiped out of the controls. To get this content in the email, can you try to update your expression as:
     
    If(
    !Form1.Valid, SubmitForm(Form1),
    SubmitForm(Form1);
    Navigate('Thank you');
    Notify(
    "Submitted new record.",
    NotificationType.Success
    ),
    Office365.SendEmail(
    User().Email,
    "Intake Form - Submission Confirmation : " & Form1.LastSubmit.ColumnName,
    "Hi <b></b>" & Left(
    User().FullName,
    Find(
    " ",
    User().FullName
    ) - 1
    ) & "," & " <br><br>
    Thank you for your submission." & "<br><br><b></b>" & "We will review and respond no later than two (2) business days. <br><b> <b></b></b>" & " <br> Please feel free to reach out to @abc@XYZ.com if you have any questions.<b></b><br>" & "<br>Thanks!" & "<br><br><br><br><br><br>-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" & "<br><b><br>Project Name : </b>" & Form1.LastSubmit.ProjectName & "<br><b><br>PR # </b>: " & Form1.LastSubmit.PR& "<br><b><br>Business Group : </b>" & Form1.LastSubmit.BusinessGroup& "<br><b><br>Third Party Supplier : </b>" & Form1.LastSubmit.ThirdPartySupplier & "<br><b><br>Brief Description : </b>" & Form1.LastSubmit.Description& "<br><b><br>Notes : </b>" & Form1.LastSubmit.Notes& "<b></b><br>",
    {
    IsHtml: true,
    Importance: "Normal",
    Cc: "SP@XYZ.com"
    }
    )
    );
     
    Here, the highlighted parts need to be replaced with Form1.LastSubmit.<column you want to fetch>
     
    Hope this Helps!
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • Community Power Platform Member Profile Picture
    on at

    Thanks so much, Yash. The suggested solution worked and I can see user input in the email.

     

    I have a follow-up question. 

     

    Do you think using Flow is a good option instead of sending directly from PowerApps office 365 logic? 

     

    I have also tried keeping this entire email notification logic on Success instead of On Select Submit button, however getting some different error when tried changing the logic on Select. Not sure, if this is the right way to do. Please advise. 

     

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @Anonymous 

     

    It depends on the usecase/ senario entirely. You can directly send the email through powerapps if there are no customizations to this email body. In case, you have such a requirement where you want to perform some operations based on user inputs, then using a flow would be better.

     
    When you tried to use this on "OnSuccess" property, what was the error that you got? I carried out a test on my side and I am able to use the same expression on the OnSuccess property with the LastSubmit attributes.
     
    Hope this Helps!
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • Community Power Platform Member Profile Picture
    on at

    I found another issue with this. When the form is in edit mode, I am getting user input in the email, but the same logic doesn't work once I published. Please help with this issue.

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @Anonymous 

     

    Are you trying to save record in New form mode or Edit Form mode? I thing here is, you need to initialize the form state using NewForm() and EditForm(). Please share more details about the implementation, so that we might be able to help you better.
     
    Hope this Helps!
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • Community Power Platform Member Profile Picture
    on at

    Yash @yashag2255 ,

    I have just one form New and I have used below code On Success 

     

    Form1;NewForm(Form1);
    Navigate(
    'Thank you',
    ScreenTransition.Fade
    )

     

    And, I have set default mode to New.

     

    Is there anything else I am missing?

     

     

  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    Can you try to change the configs as:
     
    OnSuccess: Navigate(
    'Thank you',
    ScreenTransition.Fade
    )
     
    Screen -> OnVisible -> NewForm(Form1)           //This gets triggered when someone navigates to this page from other page or the page is refreshed.
    Or, else you can create a button to initialize the form as:
    Button -> OnSelect -> NewForm(Form1)
     
    Hope this Helps!
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • Community Power Platform Member Profile Picture
    on at

    Thanks Yash.

    It worked.

     

    Now, i can see the user input in the notification email.

     

    The only other issue i can see is that email is coming from Reqester email id to the requester

    Is there a way we can change From email id to something static mail id like ABC@XYZ.COM ?

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @Anonymous 

     

    You can only set the From address if you either have permission to send email on behalf of other user or if you have a Shared Mailbox. You can then set the From property in the SendEmail action.
     
    Hope this Helps!
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard