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 / Create Event DateTimes...
Power Automate
Suggested Answer

Create Event DateTimes Incorrect Formatting & Assigned to Wrong Dates

(0) ShareShare
ReportReport
Posted on by 2
Hi,
 
We're using Microsoft Forms to capture Events for our calendar. The form has fields for the event Date (date format) and start and end times (as strings either formatted as 9:30am or military time). I'm taking the response from the form and feeding it through a flow that gets response details and then uses those details to create an event. When I input the start and end times from the form response into the Create Event fields, it runs properly and creates the event with all of my details...just on the wrong date. It keeps defaulting to creating the event today when I instead need it to create the event on the date provided by the form which is an unknown variable and could be any day. But there's no field for Date in the Create Event action, so I can only assume it's pulling today's date and my form's times to create the DateTime that it's using for the event. I've tried using various expressions to convert the time and date into a format that it'll accept so that it creates the event on the proper date, but to no avail. I get error messages like the following:
 
InvalidTemplate
Unable to process template language expressions in action 'Create_event_(V4)' inputs at line '0' and column '0': 
'The template language function 'convertToUtc' expects a timestamp as the first parameter, a source time zone 
as the second parameter, and an optional format string as the third parameter. The function was invoked with '1' parameter(s). 
Please see https://aka.ms/logicexpressions#ConvertToUtc for usage details.'.
 
Expressions & things I've tried:
  • convertToUtc(formatDateTime(concat(outputs('Get_response_details')?['body/r9a705e8682884e4cabba7710ed88b94e'], ' ', outputs('Get_response_details')?['body/radb4fd1a13ef476aad6689fa48766aa0']), 'yyyy-MM-dd HH:mm:ss'), 'Central Standard Time')
  • concat(outputs('Get_response_details')?['body/r9a705e8682884e4cabba7710ed88b94e'], 'T', outputs('Get_response_details')?['body/radb4fd1a13ef476aad6689fa48766aa0'])
    plain text string of the datetime, for example: "2025-02-19T15:30:00
  • I've referred to the documentation listed in the error message and this has not been helpful
Is there a better way I should be doing this? I don't want recurring events or even events on a specific day. They need to be determined by the event supplied by the form that people are filling out. 
 
Thanks in advance. 
 
Categories:
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    I answered pretty much the same question for someone else yesterday here: 'Create event (V4)' Always Sets the Wrong Time. See if that applies to you as well. You just need to remove the convertToUtc portion and format the date as noted in this post (yyyy-MM-ddTHH:mm).
     
    SharePoint saves dates in UTC time. Your expression is saying the stored date is in Central Standard Time, which it is not, and this is why it is not correct. The reason you choose the time zone in the Create event action is because it expects the values in the start and end time to be UTC values, which is why you specify the time zone so it can do the conversion.
  • BJ-20021815-0 Profile Picture
    2 on at
    Thank you! That was it. I had to update both the Start and End times to resemble the following:
     
    concat(outputs('Get_response_details')?['body/r9a705e8682884e4cabba7710ed88b94e'], 'T', formatDateTime(outputs('Get_response_details')?['body/radb4fd1a13ef476aad6689fa48766aa0'], 'HH:mm'))
     
    Now it's working like a charm. I spent sooooo long on this. Thank you again!

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard