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.
Solved! Go to Solution.
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:
utcNow()
End Time set to following formula:
addDays(utcNow(),4)
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')
Image reference:
The flow works successfully as below:
Best regards,
Kris
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:
utcNow()
End Time set to following formula:
addDays(utcNow(),4)
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')
Image reference:
The flow works successfully as below:
Best regards,
Kris
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
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?
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
User | Count |
---|---|
44 | |
41 | |
36 | |
36 | |
22 |
User | Count |
---|---|
40 | |
34 | |
28 | |
27 | |
27 |