web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Format all planner tas...
Power Automate
Unanswered

Format all planner task dates in Flow

(0) ShareShare
ReportReport
Posted on by 42

Hi

I am trying to format dates for planner tasks when I email them.

 

I followed this solution

https://powerusers.microsoft.com/t5/Building-Flows/Planner-Flow-Date-Value-Format-Error/m-p/249542#M24796

 

I have found that if there is no date in the planner task due date, the flow will fail to run, is there any way to skip trying to format the date if the duedate is null?

 

I also need to do this to the start date and the completed date, is there an elegant way to basically get all the dates from the task details and if there are any dates present format them so I can use them in an email template?

 

Thanks in advance!

Categories:
I have the same question (0)
  • Verified answer
    RezaDorrani Profile Picture
    12,143 on at
    Re: Format all planner task dates in Flow

    Hi @surfer1978 

     

    In that second compose 2 action

    use the following expression

     

    if(equals(outputs('Compose'),null),'',formatDateTime(outputs('Compose'),'yyyy-MM-dd'))
    This will only format the date if it exists else output blank
     
    You can do the same for the other date fields
     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at
    Re: Format all planner task dates in Flow

    @surfer1978 

    Reza and I responded at the same time....his is better. go with that 😉   

     

    Hi there!

    So...dates are all going to be stored the same way.  I'm guessing you'll want to change the presentation before they are presented in an email, right?

    There are a few ways to go about this depending on how comfortable you are with expressions.  It's not my strongest point, but I've found this kind of thing to be handy...

     

    Here's the one from the thread you mentioned:     formatDateTime(outputs('Compose'),'yyyy-MM-dd')


    So, we want to see if the field is empty before trying to format it, right?   Try this in the expression box:   if(empty(outputs('Compose'),'',formatDateTime(outputs('Compose'),'yyyy-MM-dd')))

     

    Totally winging it so it may yell at you, but basically asking if there's a value in the output, and if not keep it blank, and if so, format the value.

     

    Keep us posted.

    -Ed-

     

     

    If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

  • v-alzhan-msft Profile Picture
    on at
    Re: Format all planner task dates in Flow

    Hi @surfer1978 ,

     

    Have your problem been solved?

    Please take a try with @edgonzales's  and @RezaDorrani 's  solution, and you could also consider adding a Condition under the Compose 2 action to check if the task due date is null, and you could add different Set TaskDetails Variable for the task due date in the If yes and If no branch of the Condition.

     

    Best regards,

    Alice       

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • surfer1978 Profile Picture
    42 on at
    Re: Format all planner task dates in Flow

    Thank you @RezaDorrani  that worked perfectly 

  • Community Power Platform Member Profile Picture
    on at
    Re: Format all planner task dates in Flow

    Hi

     

    I have the exact same issue as this. I have edited the template flow task which emails outstanding tasks to a group at a given time.

     

    I've used the formatDatetime expression to get the dates the way I want them(the email shares title of task, start date and due date).

     

    When there is no start date/due date the flow fails. I've tried to edit the expression and add:

     

    if(equals(outputs('Compose'),null),'',formatDateTime(outputs('Compose'),'dd-MM-yyyy'))

     

    but it just tells me that the expression is invalid. Any ideas?

     

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard