Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 4E10csykGdkSZUjITqBCrm
Power Automate - Building Flows
Unanswered

Converting form submission date and time to ISO 8601

Like (0) ShareShare
ReportReport
Posted on 20 Oct 2022 19:49:13 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')".

  • bridges164 Profile Picture
    8 on 01 Nov 2022 at 15:39:29
    Re: Converting form submission date and time to ISO 8601

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

  • Ellis Karim Profile Picture
    10,936 Super User 2025 Season 1 on 01 Nov 2022 at 14:54:58
    Re: Converting form submission date and time to ISO 8601

    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 01 Nov 2022 at 14:32:20
    Re: Converting form submission date and time to ISO 8601

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

  • Ellis Karim Profile Picture
    10,936 Super User 2025 Season 1 on 20 Oct 2022 at 22:58:26
    Re: Converting form submission date and time to ISO 8601

    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

  • Ellis Karim Profile Picture
    10,936 Super User 2025 Season 1 on 20 Oct 2022 at 22:42:38
    Re: Converting form submission date and time to ISO 8601

    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.

  • bridges164 Profile Picture
    8 on 20 Oct 2022 at 22:08:14
    Re: Converting form submission date and time to ISO 8601

    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
    10,936 Super User 2025 Season 1 on 20 Oct 2022 at 21:40:10
    Re: Converting form submission date and time to ISO 8601

    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 20 Oct 2022 at 21:20:51
    Re: Converting form submission date and time to ISO 8601

    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
    10,936 Super User 2025 Season 1 on 20 Oct 2022 at 20:57:14
    Re: Converting form submission date and time to ISO 8601

    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.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,751 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard