cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
MitchG
Level: Powered On

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

Re: Convert string to date time for Teams task

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!

MitchG
Level: Powered On

Re: Convert string to date time for Teams task

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

Dual Super User
Dual Super User

Re: Convert string to date time for Teams task

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
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,964)