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

Error: Expected a valid date value as the parameter to 'TimezoneOffset' function, received value : null.

Hello,

 

We have an application that stores Request objects in SQL. One field in a Request is the Submitted Date (Date Time), and upon opening a request it calculates the Submitted Date by using TimezoneOffset. The current code is:

 

 

DateAdd(selectedRequestForApproval.SUBMITTED_DATE, -TimeZoneOffset(selectedRequestForApproval.SUBMITTED_DATE), Minutes)

 

 

When opening the first Request in the users session a TimezoneOffset error appears, however the field always appears correct. Note that it does not appear anytime after the first Request unless the page is refreshed. Error: "Expected a valid date value as the parameter to 'TimezoneOffset' function, received value : null."

 

I have tried modifying the code slightly for error handling, however nothing has fixed this issue. Here are some examples:

 

 

DateAdd(selectedRequestForApproval.SUBMITTED_DATE, (-TimeZoneOffset(selectedRequestForApproval.SUBMITTED_DATE)), Minutes)

DateAdd(selectedRequestForApproval.SUBMITTED_DATE, If(Isblankorerror(-TimeZoneOffset(selectedRequestForApproval.SUBMITTED_DATE)),0,-TimeZoneOffset(selectedRequestForApproval.SUBMITTED_DATE), Minutes))

If(Isblankorerror(-TimeZoneOffset(selectedRequestForApproval.SUBMITTED_DATE)),"",DateAdd(selectedRequestForApproval.SUBMITTED_DATE, -TimeZoneOffset(selectedRequestForApproval.SUBMITTED_DATE), Minutes)

 

 

Any idea on why this error is appearing and how to get it to stop appearing?

 

Thanks

2 REPLIES 2
Tqphan87
Advocate I
Advocate I

This exact issue has been happening recently for me as well when it's never done so before this month. The date still shows as normal too. 

SamBates
Frequent Visitor

I unfortunately have not found a solution yet. It seems that it may be a PowerApps bug versus a code issue.

 

Let me know if you find anything!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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