cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Renegade34G
Frequent Visitor

Pass Date to O365 V2 Email Subject Line

I am trying to pass a date from the date picker which is stored in a variable "value_ProofDate". When you click on ".Selected Date", the date that you pick shows up as you can see from the picture below. I use this same variable in an HTML text field which you can see below the first picture. Does the email function need some extra code to make it work? I'm stumped why the variable shows in the HTML text but not the email subject line.

 

Renegade34G_1-1630420969858.png

Renegade34G_2-1630421013081.png

 

 

 

 

Office365Outlook.SendEmailV2(
    Concat(
        Combo_CSRs.SelectedItems.mail,
        mail & ";"
    ) & Concat(
        Combo_Artists.SelectedItems.mail,
        mail & ";"
    ), // "extra email here",
    "TPS Submission- " & Customer_frm.LastSubmit.ID & "- Proof by Date: " & value_ProofDate.SelectedDate,
    "<h1>Form Submission</h1>" & Html_custInfo.HtmlText & "<br><br>" & Html_itemInfo.HtmlText,
    {
        Attachments: AddColumns(RenameColumns(value_attachments.Attachments, "Value", "ContentBytes"),"@odata.types",""),
        Importance: "Normal",
        IsHtml: true,
        Cc:User().Email
        
    })

 

 

 

 

8 REPLIES 8
zmansuri
Super User
Super User

if you are string selected date from date picker into variable then no need to use SelectedDate inside.

just use variable name.

 

value_ProofDate
Renegade34G
Frequent Visitor

I tried that and it does not work either.

is & missing ?

 

& value_ProofDate.SelectedDate,&
"<h1>Form Submission</h1>" &

timl
Super User
Super User

Hi @Renegade34G 

You could try converting the date by calling the Text function and optionally providing a format. This would rule out the concatenation of a string and a date object as the cause of the problem.

 

Text(value_ProofDate.SelectedDate,DateTimeFormat.ShortDateTime)

 

Renegade34G
Frequent Visitor

The TPS Submission is the start of the subject line and at the end by selectedDate is a comma, signaling the end of the subject line. If I add an &, it errors out with "unexpected char...."

Renegade34G
Frequent Visitor

I made the change and it still did not work. The email still comes across with the subject line but not the variable for the date. In fact, all date fields do not come across. I'm curious if any one can make a simple app and include a date picker and pass that variable to the O365 V2 email and try emailing it.

Office365Outlook.SendEmailV2(
    Concat(
        Combo_CSRs.SelectedItems.mail,
        mail & ";"
    ) & Concat(
        Combo_Artists.SelectedItems.mail,
        mail & ";"
    ), // "extra email here",
    "TPS Submission- " & Customer_frm.LastSubmit.ID & "- Proof by Date: " & Text(value_ProofDate.SelectedDate,DateTimeFormat.ShortDateTime),
    "<h1>Form Submission</h1>" & Html_custInfo.HtmlText & "<br><br>" & Html_itemInfo.HtmlText,
    {
        Attachments: AddColumns(RenameColumns(value_attachments.Attachments, "Value", "ContentBytes"),"@odata.types",""),
        Importance: "Normal",
        IsHtml: true,
        Cc:User().Email
        
    })

.  

Renegade34G
Frequent Visitor

This may change but I just made a simple app with a date picker and it works. However, my data field is pulling from a SharePoint list and put into the PowerApps form. It appears there is more guts to a SharePoint date picker.

 

This is just a plain date picker

Renegade34G_0-1630424691388.png

 

This is a date picker from SharePoint

Renegade34G_1-1630424711031.png

 

I am still able to grab the data from the "value_ProofDate" in all other places except email. Could this be a bug?

Renegade34G
Frequent Visitor

I will not mark this as an answer because it is a workaround. I created a label and pulled the date from the value_ProofDate field. In the subject line, I then pointed to the label field and it works.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,320)