Hi
I am trying to format dates for planner tasks when I email them.
I followed this solution
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!
Solved! Go to Solution.
Hi @surfer1978
In that second compose 2 action
use the following expression
Regards,
Reza Dorrani
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @surfer1978
In that second compose 2 action
use the following expression
Regards,
Reza Dorrani
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
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.
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.
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.
User | Count |
---|---|
87 | |
57 | |
39 | |
35 | |
33 |
User | Count |
---|---|
79 | |
67 | |
57 | |
49 | |
41 |