Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

0

Power Apps Date Write Back

I have developed an app and as part of it's function it writes the current date time into a field in the SQL server table to show when the update took place. 

When i tested the app on my local machine the date wrote perfectly to the table. 

I have now published the app and users are now entering date with it via a remote desktop service. Everything is working perfectly accept now the date being written is nonsense. 

For example

I wrote a record on my local machine and the date written was 25/11/2021 18:23:00 which was correct in the UK

When i logged into RDS service and completed the same task the date was written as 11/01/2023 18:27:01

When i checked records add yesterday the date was 11/12/2022 and the day before 11/11/2022. 

So it seams to be incrementing a month or something. I understood that Powerapps took the Text(now() date from the browser date. I checked this in RDS and the browser is showing the correct date. 

Any ideas what is going on here. or anyone had the same problem?

Thanks

Status: Delivered

Hi @AJMPaul 

 

That's great! Thanks for your reply. 

 

Best Regards,

Community Support Team _ Caiyun

Comments
v-cazheng-msft
Community Support
Status changed to: Investigating

Hi @AJMPaul 

 

May I know whether your app is an Embedded app that developed by yourself? And when you test with correct date 25/11/2021 18:23:00, you will see the incorrect date 11/01/2023 18:27:01 in your RDS, right? If so, please check your code how it will handle this input date and how you set your date column in your RDS.  

 

Best Regards,

Community Support Team _ Caiyun

AJMPaul
New Member

Hi Caiyun

Yes the App is imbedded in Power BI. The field in the SQL server Table that the date is written to is a DateTime field. I was under the assumption that the date was taken from the browser, maybe this may not be the case then if the App is imbedded? Are you saying that maybe the date is being pulled from the remote desktop settings. From what i can see, the date being written is incrementing by one month. So 25/11/2021 = 11/01/2023, 26/11/2021 = 11/02/2023, 27/11/2021 = 11/03/2023. The minutes and seconds are always correct. I would imagine that this trend would continue. As i said, when i use the PowerBI App with the imbedded PowerApps the date writes correctly. Can you see any correlation to how the date is being written. Maybe i should be capturing the date as YYYY/MM/DD and not DD/MM/YYYY as i am currently doing, which may be confusing the PowerApps, when writing the date to the table.

Many thanks for trying to assist me with this.

Paul

v-cazheng-msft
Community Support

Hi @AJMPaul 

 

Thanks for your reply! According to the sample data from you, it seems that the written value was incremented by nearly two years but not one month. In earlier comments, you said  you found Power Apps treat date from the browser as Text type. If so, could you please do a little test and change the date column written this input value to varchar type but not date type to see whether the correct input value was sent to your SQL Server?

 

Best Regards,

Community Support Team _ Caiyun

AJMPaul
New Member

Hi Caiyan

I have sorted this out now. It seems that my local machine's browser language was set to English (United States) and the RDS Browser was set to English (United Kingdom) I set my local machine to match the RDS browser and altered the power Apps date to record as mm/dd/yyyy and everything records correctly.

Happy Days.

Thank you for your assistance.

Regards

Paul

v-cazheng-msft
Community Support
Status changed to: Delivered

Hi @AJMPaul 

 

That's great! Thanks for your reply. 

 

Best Regards,

Community Support Team _ Caiyun