cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
satishpandey
Helper I
Helper I

Unable to display user input in the email notification

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"
}
)
);

2 ACCEPTED SOLUTIONS

Accepted Solutions
yashag2255
Dual Super User II
Dual Super User II

Hi @satishpandey 

 

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!

View solution in original post

Hi @satishpandey 

 

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!

View solution in original post

9 REPLIES 9
yashag2255
Dual Super User II
Dual Super User II

Hi @satishpandey 

 

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!

View solution in original post

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. 

 

Hey @satishpandey 

 

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!

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.

Hey @satishpandey 

 

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!

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?

 

 

Hi @satishpandey 

 

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!

View solution in original post

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 ?

Hey @satishpandey 

 

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!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,287)