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
yashag2255
Dual Super User II
Dual Super User II

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

yashag2255
Dual Super User II
Dual Super User II

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,809)