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.