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 / Dates missing in email
Power Apps
Answered

Dates missing in email

(0) ShareShare
ReportReport
Posted on by 726

Recently two of my date fields have stopped showing in the email that is sent when a form is successfully submitted, I have link in the email that opens to an approval form, the dates in here show and are correct its just missing from the email that is sent to the line manager. 

 

Office365Outlook.SendEmailV2(DataCardValue12.Text, "Annual Leave Submitted by " & DataCardValue16.Text, "<font face = Calibri size = 7><font color=black> Request Details </Font></Font> <br> 
<br><b> Full Name: </b>" & DataCardValue16.Text & 
"<br><b>Job Title: </b> " & DataCardValue17.Text & 
"<br><b>Department: </b> " & DataCardValue18.Text & 
"<br><b>Reason: </b>" & Form2.LastSubmit.Reason.Value &
"<br><b>Country Of Destination: </b>" & Form2.LastSubmit.CountryOfDestination &
"<br><b>Start Date: </b>" & Text(StartDate.SelectedDate,"[$-en-US]dd-mmm-yyyy") &
"<br><b>End Date: </b>" & Text(EndDate.SelectedDate,"[$-en-US]dd-mmm-yyyy") &
"<br><b>Days Absent: </b>" & Form2.LastSubmit.'Days Absent' &
"<br><b>Please review Annual Leave Request</b>" & "<a href='https://apps.powerapps.com/play/xxxxxxxxxxxxxxx&AbsenceRequest=" & Form2.LastSubmit.ID & "'> HERE </a> " & "<br>" & "<br>" & "__________________________________");{ IsHtml:true, Importance: "Normal",From:"SharePoint_NoReply@xxxxxxx.onmicrosoft.com"}; UpdateContext({vEmailSend:false});Notify("Data saved successfully and Email Sent to Line Manager", NotificationType.Success)

 

this is sent OnSuccess 

 

here is the two fields that are now returning blank, Nothing has changed it just stopped working a few days ago.

 

"<br><b>Start Date: </b>" & Text(StartDate.SelectedDate,"[$-en-US]dd-mmm-yyyy") &
"<br><b>End Date: </b>" & Text(EndDate.SelectedDate,"[$-en-US]dd-mmm-yyyy") &

 

I have tried to change the fields to just 

EndDate.SelectedDate

this still returns blank 

 

I have also done a test when where i have just added a button to send an email to me with the dates, and this comes though as i would expect. 

 

Categories:
  • C-Papa Profile Picture
    1,836 on at

    try changing to Text(Form2.LastSubmit.StartDate) assuming StartDate is the column name. 

     

    i think this is because this is on the onsuccess of the form, but the datepickers are resetting once the form is submitted, so when the email is sent, the answers are blank. 

     

     

  • WarrenBelz Profile Picture
    156,520 Most Valuable Professional on at

    Hi @amyharkus86 ,

    Is StartDate a field name or date picker name? You are referring all the other values to controls, so this one is better that way - refer to Text(StartDateDatePickerName.SelectedDate, . . . .)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • amyharkus86 Profile Picture
    726 on at

    Yes, the StartDate field is the date picker name. 

     

    I've tried both of those on a test just sending an email to  OnSuccess 

     

    Office365Outlook.SendEmailV2("amy.harkus@xxxx.com", "TEST " ,
    
    "<br><b>Start Date: </b>" & Text(Form2.LastSubmit.StartDate) &
    "<br><b>End Date: </b>" & Text(StartDate.SelectedDate,"[$-en-US]dd-mmm-yyyy") )

     

    As a further test i added a button that Onselect ands the same code as above this works on the 

     

    Text(StartDate.SelectedDate,"[$-en-US]dd-mmm-yyyy") 
  • C-Papa Profile Picture
    1,836 on at

    lets try this another way, set the onchange property of the StartDate to

     

    Set(var_StartDate,Text(StartDate.SelectedDate,"[$-en-US]dd-mmm-yyyy"))

     

    and EndDate on change to 

     

    Set(var_EndDate,Text(EndDate.SelectedDate,"[$-en-US]dd-mmm-yyyy"))

     

    and change your html to

     

    "<br><b>Start Date: </b>" & var_StartDate &
    "<br><b>End Date: </b>" & var_EndDate )

  • WarrenBelz Profile Picture
    156,520 Most Valuable Professional on at

    @amyharkus86 ,

    There is something fundamentally wrong here - to test type this into a label

    Text(StartDate.SelectedDate,"mm/dd/yyyy")

    and see if you get the desired result.

  • amyharkus86 Profile Picture
    726 on at

    @C-Papa i tried this and sadly the same results, blank return.

     

    @WarrenBelz this shows the date, obviously not in UK format but its shows it.

     

     

  • C-Papa Profile Picture
    1,836 on at

    can you select the date picker and paste a picture of the properties and the data picker on the screen? 

  • amyharkus86 Profile Picture
    726 on at

    @C-Papa sure can, i am not adding the time fields in the email, they are not needed but do show when the line manager clicks on link in the url.

     

    amyharkus86_0-1624617069285.png

    amyharkus86_1-1624617141938.png

     

  • C-Papa Profile Picture
    1,836 on at

    can you send the advanced properties as well, specifically the top part when selecting the whole datacard.

     

    Also, does the submit of the form work ok? 

  • amyharkus86 Profile Picture
    726 on at

    amyharkus86_0-1624617963697.png

    amyharkus86_1-1624617996971.png

     

    Thank you

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