Showing results for 
Search instead for 
Did you mean: 
Advocate II
Advocate II

Sudden "Invalid argument type (Text). Expecting a DateTime value instead." error

Robot Happy PowerApps Survival Tactic




  • Out of the blue, you suddenly get an "Invalid argument type ... error" with code and data that you haven't changed. 


Invalid argument type (Text). Expecting a DateTime value instead.Invalid argument type (Text). Expecting a DateTime value instead.


Solution 1


  • Log out of PowerApps
  • Close all PowerApps/Office 365 related windows
  • Log in again


Solution 2


Sometimes a DateTime value read from your data source loses its "date-ness" and the numeric DateTime value gets interpreted as a String.


This solution converts the String back to a DateTime value as follows: String --> Numeric Value --> Formatted DateTime String --> DateTimeValue. 


It's convoluted, but here is the code: 


DateTimeValue( Text( Value( MyDateTimeValue ), "[$-en-US]mm/dd/yyyy hh:mm:ss") )


Advocate II
Advocate II

Same problem here, all of our applications using the CDS went down during a demo, this gives a really bad image to the product.


Please look into it.

Helpful resources

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,413)