cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kudo Kingpin
Kudo Kingpin

Formatting column values in the "Create HTML table" action

I'm trying to build a Flow using the "Get calendar view of events (V2)" action and dropping the output of that ("value") into an HTML table in an email. The idea is to send myself a message each morning with a list of calendar events for the next 4 days. I'm 90% there, but the DateTime columns are coming in UTC format. In the Create HTML table action, there does not appear to be a way to use functions (including formatting functions) in the Column/Value field. I suppose I could create a couple variables and use nested loops to format the Start and End date/time values, but that seems like an overly complicated solution. There has to be something simpler that I'm missing.

FormatValuesInHtmlTable_2018-04-27_0928.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @ChadVKealey,

 

Could you please share a screenshot of your flow's configuration?

Do you want the DateTime column (Start time and End time) to be formatted as other Date time format within your HTML table?

 

If you want the DateTime column (Start time and End time) to be formatted as other date time format within your HTML table, I think the "Select" action could achieve your needs (Add a "Select" action before the "Create HTML table" action).

 

I have made a test on my side and please take a try with the following workaround:

  • Add a "Recurrence" trigger, Interval set to 1 and Frequency set to Day.
  • Add a "Get calendar view of events (V2)" action, specify Calendar Id, Start Time set to following formula:
utcNow()

End Time set to following formula:

addDays(utcNow(),4)
  • Add a "Select" action, From set to output of "Get calendar view of events (V2)" action. Within Map entry, type following entries:13.JPG

     The corresponding vlaue of Start time key set to following formula:

formatDateTime(item()?['Start'],'MM/dd/yyyy')

The corresponding value of End time key set to following formula:

formatDateTime(item()?['End'],'MM/dd/yyyy')
  • Add a "Create HTML table" action, From set to output of the "Select" action, Include Headers set to Yes.
  • Add a "Send an email" action, Body field set to output of "Create HTML table" action, Is HTML field set to Yes.

Image reference:14.JPG

 

15.JPG

The flow works successfully as below:16.JPG

 

17.JPG

 

 

 

Best regards,

Kris

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

View solution in original post

6 REPLIES 6
Community Support
Community Support

Hi @ChadVKealey,

 

Could you please share a screenshot of your flow's configuration?

Do you want the DateTime column (Start time and End time) to be formatted as other Date time format within your HTML table?

 

If you want the DateTime column (Start time and End time) to be formatted as other date time format within your HTML table, I think the "Select" action could achieve your needs (Add a "Select" action before the "Create HTML table" action).

 

I have made a test on my side and please take a try with the following workaround:

  • Add a "Recurrence" trigger, Interval set to 1 and Frequency set to Day.
  • Add a "Get calendar view of events (V2)" action, specify Calendar Id, Start Time set to following formula:
utcNow()

End Time set to following formula:

addDays(utcNow(),4)
  • Add a "Select" action, From set to output of "Get calendar view of events (V2)" action. Within Map entry, type following entries:13.JPG

     The corresponding vlaue of Start time key set to following formula:

formatDateTime(item()?['Start'],'MM/dd/yyyy')

The corresponding value of End time key set to following formula:

formatDateTime(item()?['End'],'MM/dd/yyyy')
  • Add a "Create HTML table" action, From set to output of the "Select" action, Include Headers set to Yes.
  • Add a "Send an email" action, Body field set to output of "Create HTML table" action, Is HTML field set to Yes.

Image reference:14.JPG

 

15.JPG

The flow works successfully as below:16.JPG

 

17.JPG

 

 

 

Best regards,

Kris

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

View solution in original post

Thank you so much, that worked perfectly! Also, I finally (re)found the date/time formatting documentation (https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings) and the 'D' format is exactly what I wanted.

Actually, I found one other additional issue. The times for the events are showing as 4 hours later than they actually occur. I suspect that the time zone being used in Pacific (US) and I'm in Eastern US. 

 

I see there are expressions to convertToUTC and convertFromUTC and assume I need to wrap the previous expressions for start and end time in one of those, but I'm not sure which.

Every thing works fine for me based on your instructions with the exception the I get a date result of:

 

10/00/2018

 

I get 00 in the middle with 'dd/mm/yyyy' or 'mm/dd/yyyy' 

 

My objective is 'dd/mm/yyyy' 

 

The Function is:

 

formatDateTime(item()?['DateTo'],'dd/mm/yyyy')

 

Any ideas why?

OK solved,   I failed to recognise you use MM not mm

Frequent Visitor

I have tried all the above solutions, but can't seem to get it working.

I have raised a new post here: https://powerusers.microsoft.com/t5/Building-Flows/Format-timestamp-from-Excel-Online-to-send-mails/... 

 

Can someone please guide me?

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (7,332)