cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ThomasH
Helper III
Helper III

Format time in HTML table

Hello, I am having an HTML table created with a date, but I would like the date to be formatted differently so that it is displayed in German format as DD-MM-YYYY, how can I achieve this. In addition, if the date is greater than the current date, I would like it to be colored or highlighted in red, how could I implement this? Thanks

 

ThomasH_0-1662623705723.png

 

26 REPLIES 26

In the email you should not be using the output of the HTML table. But the output of the compose action which replaces the special characters.

@Paulie78  I have update my last Post ,

i use in the Outlook Body this 

ThomasH_1-1664302407924.png

this is from the compose.

The Email contains this

ThomasH_0-1664303569709.png

 

 

Is this right?

ThomasH_3-1664302583543.png

 

 

 

ThomasH
Helper III
Helper III

@Paulie78  Hi,

can you tell me what my fault?

I cannot see where you have gone wrong easily. But if you want I will take a quick look for you on teams. I am sure we can sort it out within a few minutes. Send me a PM if you want to do that.

@Paulie78 I have write you a PM

 

Thank you

Hello, unfortunately I still could not solve the problem.

I use the code of @Paulie78 from Post 19 to create the HTML Table

if
(
  greater(if(equals(item()?['dueDateTime'], null), '', formatDateTime(item()?['dueDateTime'],'dd-MM-yyyy')), utcNow()), 
  concat('<span style="color:red">', item()['dueDateTime'], '</span>', item()['dueDateTime']),
  if(equals(item()?['dueDateTime'], null), '', formatDateTime(item()?['dueDateTime'],'dd-MM-yyyy'))
)

 but the "Fällig" dosen't be red if the Value is greater then today.

ThomasH_0-1666982824334.png

 

 

In the next step "Verfassen" i use this code from @Paulie78 from Post 10 

replace(replace(replace(body('HTML-Tabelle_erstellen'), '&lt;', '<'), '&quot;', '"'), '&gt;', '>')

ThomasH_1-1666982844697.png

and then i create my Email

with this code 

<html>
<head>
  <style> 
table, th {
    border:1px solid black;        
}
td {
    border:1px solid black;
    text-align:left;
    width:20%;
}
  </style>
</head>
<body>
@{outputs('Verfassen')}<br>
<strong>Bearbeitungsstatus:<br>
0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=Nicht begonnen<br>
50 &nbsp;&nbsp;&nbsp;=in Bearbeitung</strong><br>
<strong>100 = Abgeschlossen</strong><br>
</body>
</html>

"Ausgabe" is from "Verfassen"

ThomasH_2-1666982906791.png

 

then i become a Email, but as I wrote, the due date is not marked in red if the date is later than the current date and the individual fields in the table are not filled correctly as can be seen in the picture.

ThomasH_3-1666983317486.png

 

Who is my fault, and how i can correct it?

 

Thank you for your help.

 

 

ThomasH
Helper III
Helper III

Anybody a Tip for me?

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (5,085)