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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (1,632)