cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MitchG
New Member

Convert string to date time for Teams task

Hello,

 

My team typically receives an email with a task in the body. Included in this task is a due date. I have created a flow that parses the email we receive, extracts the date time string, and creates a new task in Microsoft Teams with that due date in the title of the newly created task. Instead, I would like to convert this string to a due date for the newly created task. Can someone help me?

3 REPLIES 3

Hey @MitchG 

 

Can you share more details? Maybe a screenshot of the flow that you have built so far?

 

You can use the format date time expression to convert the string to the appropriate format and add the due date:

ddew2.PNG

 Expression: 

formatDateTime(outputs('Compose'),'yyyy-MM-dd')

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Hello,

 

I tried doing this using a "Compose" action, but I get an error:

 

InvalidTemplate. Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2769': '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.'.

 

Any tips?

 

The date that I parse out of the body  of the email comes in this format: Friday, December 13, 2019 11:00 PM

Hey @MitchG 

 

Ah, that is why it is throwing the error. For the expression to work, the date string should be in ISO 8601 format. But you can try the below configuration and check if it works. 

ffe3.PNG

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (5,105)