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 III
Advocate III

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

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (5,698)