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')".
I did see it but I'm having trouble putting it into a single expression rather than multiple steps.
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
Ok, so this works, but I need the Date AND Time.
where this post links to a blog where with a number of expressions that convers the Excel time to a date
Ellis
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')
Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.
I have double checked both step 1 and step 2.
The Filter Array input has them like this...
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.
(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
(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')
{
"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.
ok, so you're saying that my expression should be
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.
WarrenBelz
146,751
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional