Hi, so I'm trying to use this flow template which will create a task in planner when I post a new message to a Teams channel.
However, the flow fails with the following error - The request is invalid: Cannot convert the literal '' to the expected type 'Edm.DateTimeOffset'.
I tried formatDateTime but it shows the same error. I tried utcnow() as well. Here is what the original flow looks like:
This is the error with the above flow:
Here are the expressions I tried:
All show the same error as above. So I tried converting it to dd/MM/yyyy using this expression:
Still it failed with the same error:
Please tell me what should I do. I saw other posts where some or the other formula from the above worked for people. For some reason, they are not working for me!
Its expecting a DateTime in ISO 8601 format. If the time you are inputting is already in UTC then you can format it using the following
. If you don't specify a format string it will use UTC 8601.
if the time you want to use is in a Local time zone then convert it using the following, where 'Eastern Standard Time' is replaced by the name of the local timezone.
convertToUtc(inputtime,'Eastern Standard Time')
Hi, I tried this and still got an error -
"The template language function 'convertToUtc' expects its second parameter to be a time zone matching the time zone indicated by the timestamp. The provided value '(UTC-05:00) Eastern Time (US & Canada)' is not valid or does not match the timestamp '2021-05-19T16:03:55.5490000Z"
This is the default format in which the date is in: 2021-05-19T16:03:55.5490000Z
The error is because the timestamp you are using is already in UTC, not in the local timezone. So you can't convert it to UTC from Eastern time. You should be able to use that value directly or use the first version that just formats it to ISO 8601.
That's what! It's giving an error in the default UTC format as well as the first version of ISO 8601.
Both the cases: 2021-05-19T16:03:55.5490000Z & 2021-05-19 or 19-05-2021 are showing the 'Cannot convert the literal '' to the expected type 'Edm.DateTimeOffset' error
Is this a flow based on a Template? The screenshot you posted is slightly different than the current action to Create a Task. If it is based on a template you might want to deleting the action and re-adding the current supported action. I tried to recreate your error using a literal timestring and UTCNow() and both worked without error.
Yes, it's working when I replicate the above. But not with the teams dynamic content.
Default template flow:
As you can see, the Start Date Time is literally the same in both cases
Ok, let me take a look at it with a trigger like you are using.
I changed the trigger and it still works for me. I'm not sure what the issue is for you.
Make sure all the actions in the flow are using the most recent version. One of the problems with templates is that they often break after underlying actions are updated. Those updates are happening constantly. I'm working off a hand built flow, not a template.
Check out the News & Announcements to learn more.
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.
Check out our new Discover Your Career Path blog post series and get all the details.