cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ChadVKealey
Impactful Individual
Impactful Individual

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
v-xida-msft
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
v-xida-msft
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

HarshavardhanG
Helper I
Helper I

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,404)