web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Trying to format Date ...
Power Automate
Unanswered

Trying to format Date and Time of Created field for a SharePoint list

(0) ShareShare
ReportReport
Posted on by 27

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 flowOutline of flowAppending HTML codeAppending HTML codeMissing dynamic contentMissing dynamic content

 

 

Categories:
I have the same question (0)
  • Verified answer
    abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Ian-Murphy 

     

    Click expression

     

    image.png

     

    Copy the below expression and paste it. 

     

    formatDateTime(items('Apply_to_each')?['Created'], 'dd-MM-yyyy')

     

    Thanks

  • Ian-Murphy Profile Picture
    27 on at

    Thank 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?

     

     

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    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.

  • Ian-Murphy Profile Picture
    27 on at

    It'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! 👍

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard