web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Converting form submis...
Power Automate
Unanswered

Converting form submission date and time to ISO 8601

(0) ShareShare
ReportReport
Posted on by 8

Error Message: "Unable to process template language expressions in action 'Create_event_(V4)' inputs at line '0' and column '0': 'In function 'formatDateTime', the value provided for date time string '44855.7916666667' was not valid. The datetime string must match ISO 8601 format.'."

First, I have an excel form setup where the user inputs the beginning date/time and the the end date/time.
In the flow, I have a List rows set to use DateTime Format: ISO 8601.
It then filters the responses for specific conditions using Filter Array
Next it cycles through the filtered responses using Apply to each.
For each response, it's supposed to create a calendar event but I get the error message above.

I don't understand how I'm supposed to convert it to be ISO 8601 using power automate. 

I'm using the expression "formatDateTime(item()['Event Start Date Time'],'yyyy-MM-ddTHH:mm:ss')".

Categories:
I have the same question (0)
  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    Hi @bridges164 ,

     

    See: Easily convert Excel Dates to usable Power Automate Dates (tachytelic.net) which uses the function:

     

    addDays('1899-12-30', int(item()['Date']), 'dd-MM-yyyy')

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • bridges164 Profile Picture
    8 on at

    ok, so you're saying that my expression should be 

    "addDays('1899-12-30T00:00:00',int(item()['Event Start Date Time']),'yyyy-MM-ddTHH:mm:ss')"
    instead of the one I was using before
  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    Hi @bridges164 ,

     

    (1) If you have already set the List rows present in a table to ISO 8601 (and this should work!), then you will need to try another method to convert the dates. The linked article in the previous post provides some options.

    Snag_5c9d137.png

     

    (2) Also check that the date column is set to a Date type in Excel then run the flow with the formatDateTime(item()['Event Start Date Time'],'yyyy-MM-ddTHH:mm:ss') expression

    Snag_ae1d602.png

    (3) I had instances where some dates would convert and had to resort to the expression to convert the dates.

    Here is an extract of the output of a demo flow  using the following expression:

     

    addDays('1899-12-30', int(item()?['DateAccessGranted']), 'dd-MM-yyyy')

     

    Snag_ae70519.png

    {
     "Name": "Catherine Le",
     "Date": "44854",
     "ConvertedDate": "20-10-2022"
     },
     {
     "Name": "Christopher Le",
     "Date": "44854",
     "ConvertedDate": "20-10-2022"
     },
     {
     "Name": "Martin Smith DDS",
     "Date": "44854",
     "ConvertedDate": "20-10-2022"
     },
     {
     "Name": "Stacy Rodriguez",
     "Date": "44854",
     "ConvertedDate": "20-10-2022"
     },
     {
     "Name": "Kayla Miller DVM",
     "Date": "44854",
     "ConvertedDate": "20-10-2022"
     },
     {
     "Name": "Kendra Rogers",
     "Date": "44854",
     "ConvertedDate": "20-10-2022"
     },
     {
     "Name": "Michael Young",
     "Date": "44498",
     "ConvertedDate": "29-10-2021"
     },
     {
     "Name": "Bruce Johnson",
     "Date": "44495",
     "ConvertedDate": "26-10-2021"
    

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • bridges164 Profile Picture
    8 on at

    I have double checked both step 1 and step 2.
    The Filter Array input has them like this...

    "Event Start Date Time""44858.8125",
    "Event End Date Time""44858.8958333333"

    I am then using the expression 
    "addDays('1899-12-30T00:00:00',int(item()['Event Start Date Time']),'yyyy-MM-ddTHH:mm:ss')" to try and set the Calander Event - Start Time. I receive the error "Unable to process template language expressions in action 'Create_event_(V4)' inputs at line '0' and column '0': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.".
  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    Hi @bridges164 ,

     

    Sorry, I just realised your Excel integer dates are actually floating-point numbers.

     

    You can try the following until we find a better expression, which extracts the number before the decimal point if the number is a float:

     

    addDays('1899-12-30', if(isFloat(item()?['DateAccessGranted']), int(split(item()?['DateAccessGranted'],'.')?[0]), int(item()?['DateAccessGranted'])), 'dd-MM-yyyy')

     

     

    Snag_b1f117c.png


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    See: Solved: Re: Convert Excel DateTime into displayable string... - Power Platform Community (microsoft.com)

    where this post links to a blog where with a number of expressions that convers the Excel time to a date

     

    Snag_b26ea46.png

    Ellis

  • bridges164 Profile Picture
    8 on at

    Ok, so this works, but I need the Date AND Time.

  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    Did you try flow that the post referred to here:

    Handling Date-Time in Excel to SharePoint List through MS Flow (c-sharpcorner.com)

     

    Ellis

  • bridges164 Profile Picture
    8 on at

    I did see it but I'm having trouble putting it into a single expression rather than multiple steps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard