cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alexlrca
Level: Powered On

Date picker language = User's phone language

Hello guys,

 

[CONTEXT]

  • "Leave Request" app
  • Users can create a leave request by selecting a start date and an end date in Date Pickers.
  • Date picker controls have these parameters: 
    • Format: "[$-fr-FR]dd/mm/yyyy"
    • Language: "fr-FR"
    • DateTimeZone: DateTimeZone.Local
  • Once the request is completed, an email is sent to HR with the dates selected. To do so, I wrote some lines in HTML with placeholders (i.e.: "{LeaveStart}") that are replaced by the selected dates of the user:
    • ClearCollect(HTMLTemplate, {Field: "{LeaveStart}", Data: Text(LeaveStartDatePicker.SelectedDate,"[$-fr-FR]mmm. dd, yyyy")})

[ISSUE]

In the email, the date is not entered in French (as specified by the format of the DatePickers) but in the language of the user's phone (for instance, if the language of the user's phone is Italian, the month will appear in Italian in the mail).

 

[DESIRED OUTPUT]

I'd like that, in the email that is sent to HR, the language stays in French. How can I do so?

 

If you have any additional questions, don't hesitate to let me know. I'll do my best to provide you with as most information as possible.

 

Regards,

4 REPLIES 4
EricLott
Level 10

Re: Date picker language = User's phone language

This is odd, as I imagine your ClearCollect() function saves the date as a string, not as a date. What does the Send Mail code look like? Any possibility of reformatting there?

Community Support Team
Community Support Team

Re: Date picker language = User's phone language

Hi @alexlrca ,

Do you mean that your location in powerapps is french, if you send email with the data of datepicker, the email's content will change with the receiver's phone language?

Could you tell me 

1)what does the receiver's phone language mean? Do you mean the location in someone's office365 profile ?

2)the the email's content will change with the receiver's phone language or the sender's phone language?

3)the formula that you use to send email?

I've made a similar test but not met the same problem like your description.

Here's the test for your reference:

1)the datepicker's setting:

  • Format: "[$-fr-FR]dd/mm/yyyy"
  • Language: "fr-FR"
  • DateTimeZone: DateTimeZone.UTC

2)the send emial formula:

Office365Outlook.SendEmailV2("phoebel@.....com","test",Text(DatePicker1.SelectedDate))

3)the location in the receiver's profile is Singapore

4)the received email content:

the data same as in datepicker

it not transfer with the  receiver's profile's location.

20201101.PNG

 

20201102.PNG

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
alexlrca
Level: Powered On

Re: Date picker language = User's phone language

Hi @EricLott ,

 

Thanks for your answer! 

The SendMail code is a bit messy, since there are many different conditions depending on the user's profile.

But here's how the content of the mail is coded (pretty simple): 

  • LookUp(HTMLTemplate,Row = 1).Value

It simply looks up the data in the HTML Template Collection after the placeholders were replaced with the Leave Request data of the user. That step is done like this:

ForAll(HTMLTemplate, Patch(EmailData,LookUp(HTMLTemplate,If(_managerView,Row = 2,Row = 1)),{Value: Substitute(LookUp(
EmailData,If(_managerView,Row = 2,Row = 1)).Value,Field,Data)}));

 

I actually reached a solution yesterday by changing the format of the date in the email. Instead of showing the first three letters of the month followed by the day (i.e.: Jan. 16), it shows only numbers (01/16/2020).  But still, if formatting is important for other people, this could be a problem. 

 

Regards,

 

Highlighted
alexlrca
Level: Powered On

Re: Date picker language = User's phone language

Hi @v-yutliu-msft ,

 

Thanks a lot for your help!

 

Here are my answers to your questions:

 

1) What does the receiver's phone language mean? Do you mean the location in someone's office365 profile ?

No, I don't mean the location in someone's office365 profile. I mean the selected language in the settings of the smartphone of the user. For instance, if the smartphone of my user is in Turkish, PowerApps will be in Turkish, and the format of the date that is sent by mail will also be in Turkish (instead of seeing "Janvier", I'd see "Ocak"). Please note that the issue is not about the receiver's phone language, but about the sender's phone language.

2) The the email's content will change with the receiver's phone language or the sender's phone language?
The language in which the dates are formatted in the email is changing depending on the SENDER's phone language.

The receiver's phone language doesn't impact the process.

 

3) The SendMail code is a bit messy, since there are many different conditions depending on the user's profile.

But here's how the content of the mail is coded (pretty simple): 

  • LookUp(HTMLTemplate,Row = 1).Value

It simply looks up the data in the HTML Template Collection after the placeholders were replaced with the Leave Request data of the user. That step is done like this:

ForAll(HTMLTemplate, Patch(EmailData,LookUp(HTMLTemplate,If(_managerView,Row = 2,Row = 1)),{Value: Substitute(LookUp(
EmailData,If(_managerView,Row = 2,Row = 1)).Value,Field,Data)}));

 

4) Regarding the test you made: please note that the date format that I used is not the same: "[$-fr-FR]mmm. dd, yyyy" is the one I used (the month isn't displayed with numbers, but with the first three letters (i.e.: "Jan" for "January" and not "1"). This is how the problem can be noticed. When using numbers, the problem cannot be seen.

 

 

I actually reached a temporary solution yesterday by changing the format of the date in the email and only using numbers, as you did in your test. Instead of showing the first three letters of the month followed by the day (i.e.: Jan. 16), it shows only numbers (01/16/2020).  But still, if date formatting is important for other people and they must show the month in letters, this could be a problem. 

 

Regards,

 

 

 

 

 

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

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