I've built a flow that creates a series of HTML tables from multiple lines of a SharePoint list. I've done this by initializing a variable, adding the HTML header, getting the list items, creating a table for each one, adding the HTML footer and then emailing the entire construct. This will eventually be automated, running daily, but for testing purposes, I run it manually.
It's been working fine, but the problem I've encountered is I'm returning the Created field from the SharePoint list and I can't seem to format the date and time into something reasonable.
I've tried using the FormatDateTime expression, but when I do, I don't have the option to select the dynamic content Created field.
I've tried a variety of ways to manually build an expression that would allow me to format the Created field data, but nothing works.
I looked at the code and the dynamic content that I'm trying to format is:
@{items('Apply_to_each')?['Created']}
I know I shouldn't wrap the entire thing in the FormatDateTime expression, but every version returns, "The expression is invalid."
I feel like I'm very close, but just can't figure out what I'm doing wrong.
I'm hoping this is something very simple that I'm just missing due to my inexperience.
Thank you, for any suggestions, or help, anyone can provide.
Outline of flow
Appending HTML code
Missing dynamic content
Solved! Go to Solution.
Hi @Ian-Murphy
Click expression
Copy the below expression and paste it.
formatDateTime(items('Apply_to_each')?['Created'], 'dd-MM-yyyy')
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogHi @Ian-Murphy
Click expression
Copy the below expression and paste it.
formatDateTime(items('Apply_to_each')?['Created'], 'dd-MM-yyyy')
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogThank you very much - it worked perfectly!
Can you let me know why it worked, and what I was missing? I like learning. 😊
The code had the dynamic item listed as @{items('Apply_to_each')?['Created']} and I kept trying to apply FormatDateTime to that and kept getting an error. Why does stripping out the "@" and the Curley Braces allow me to apply the FormatDateTime function?
Hi @Ian-Murphy
Good question. So for the expressions you don't need to use the @ and { brackets. Yes when we copy the dynamic content it copies with all those characters. No idea.
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogIt's just that type of weird, secret Microsoft Lore that I knew I'd find here. I'll squirrel it away in my notes.
Thanks! 👍
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
User | Count |
---|---|
75 | |
20 | |
17 | |
14 | |
13 |
User | Count |
---|---|
127 | |
35 | |
31 | |
28 | |
25 |