cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

Re: Formatting column values in the "Create HTML table" action

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

5 REPLIES 5
Highlighted
Community Support
Community Support

Re: Formatting column values in the "Create HTML table" action

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

Highlighted
Kudo Kingpin
Kudo Kingpin

Re: Formatting column values in the "Create HTML table" action

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.

Highlighted
Kudo Kingpin
Kudo Kingpin

Re: Formatting column values in the "Create HTML table" action

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.

Highlighted
Super User
Super User

Re: Formatting column values in the "Create HTML table" action

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?

Highlighted
Super User
Super User

Re: Formatting column values in the "Create HTML table" action

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

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Users online (9,018)