cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aurav
Helper I
Helper I

Format date and time in HTML issue;The execution of template action 'Create_HTML_table' failed. The column values could not be evaluated: 'In function 'formatDateTime', the value provided for date time string '44476.629212963' was not valid. The datetime string must match ISO 8601 format.'.

When I am formating the date in HTML table I am getting the below error.  How can i resolve this?

 

Not sure if this error is due to some of the cells/values being empty, 

 

Error Details

The execution of template action 'Create_HTML_table' failed. The column values could not be evaluated: 'In function 'formatDateTime', the value provided for date time string '' was not valid. The datetime string must match ISO 8601 format.'.

 

aurav_0-1664727940999.png

 

aurav_1-1664727970117.png

 

aurav_2-1664728045742.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@aurav ,

There might be empty values of the ['Contract End Time'] column ?

To avoid this error, firstly check if the value is empty of not. The formatDateTime() function does not support a empty string as value. 

So:

 

if(
  empty(item()?['Contract End Time']),
  '',
  formatDateTime(item()?['Contract End Time'],'dd-MMMM-yyyy')
)

 

 Hope it helps !

View solution in original post

3 REPLIES 3
SudeepGhatakNZ
Resident Rockstar
Resident Rockstar

What is that you have written in the expression? The date format needs to be yyyy-MM-dd

If my suggestion helped you, please give it a Thumbs up and mark it as a Solution so that it can benefit others in the community.

Hi @SudeepGhatakNZ  - I have changed the date format to be yyyy-MM-dd but still getting the same error.

 

Expression

formatDateTime(item()?['Start Date'],'yyyy-MM-dd')

 

Error

The execution of template action 'Create_HTML_table' failed. The column values could not be evaluated: 'In function 'formatDateTime', the value provided for date time string '' was not valid. The datetime string must match ISO 8601 format.'.

 

aurav_0-1664766348748.png

 

@aurav ,

There might be empty values of the ['Contract End Time'] column ?

To avoid this error, firstly check if the value is empty of not. The formatDateTime() function does not support a empty string as value. 

So:

 

if(
  empty(item()?['Contract End Time']),
  '',
  formatDateTime(item()?['Contract End Time'],'dd-MMMM-yyyy')
)

 

 Hope it helps !

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

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

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,929)