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

How to get just the Date from a newly created task in Planner

I've created a Flow which, when a new task is created in Planner, automatically posts a message in Teams and sends and email notification. I've used the "value Due Date Time" option to include the date the task is due, but it is posting it as the following:

 

2019-04-03T10:00:00Z
 
Does anyone know how I can amend this to just show the date in the format DD-MM-YYYY? I don't need to know the time.
 
Thank you. 
1 ACCEPTED SOLUTION

Accepted Solutions

Hi!

 

No problem, happy to help 🙂 

Could it be that you're date field is not from the triggerbody. Could you select the field you want to format? Like this: 

Flowdatetime.gif

View solution in original post

4 REPLIES 4
Willemijn
Resolver III
Resolver III

Hi, 

 

You should do this with the following expression: 

formatDateTime(triggerBody()?['Your datefield'],'dd-MM-yyyy')
 
image.png
 
Hope this helps!

Hi,

 

Thanks for the speedy reply. I've created the expression as per the following:

 

formatDateTime(triggerBody()?['Created'],'dd-MM-yyyy')

 

But when I run it I get the following error:

 

"InvalidTemplate. Unable to process template language expressions in action 'Post_message' inputs at line '1' and column '2667': 'The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'."

 

I've had a look at the link provided, but I can't work out what I'm doing wrong.

 

Apologies for what are probably basic question. I'm very new to Flow! 

Hi!

 

No problem, happy to help 🙂 

Could it be that you're date field is not from the triggerbody. Could you select the field you want to format? Like this: 

Flowdatetime.gif

That did it. Thank you very much 🙂

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (2,942)