Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Date format from email not working

(1) ShareShare
ReportReport
Posted on by 4
I have set up a PA to copy an email to a sharepoint site the name of the file needs to include the received datetime in a set format as it links from another system with URL.
formatDateTime(triggerOutputs()?['body/receivedDateTime'],'yyyy-MM-dd_hh:mm:ss')
 
However the format the file name is saving is using _ not : within the time section
 
 
What am i doing wrong?
Categories:
  • leonwatson Profile Picture
    leonwatson 2 on at
    Date format from email not working

    Could you provide more details about the issue with the date format in the email? For example:

    • What is the current format of the date in the email?
    • What format do you need it to be in?
  • David_MA Profile Picture
    David_MA 9,005 on at
    Date format from email not working
    While the list of invalid characters in filenames in SharePoint has gotten smaller, asPstork pointed out, the colon is still one of them as you can see at https://support.microsoft.com/en-us/office/restrictions-and-limitations-in-onedrive-and-sharepoint-64883a5d-228e-48f5-b3d2-eb39e07630fa#invalidcharacters
  • Pstork1 Profile Picture
    Pstork1 64,907 on at
    Date format from email not working
    To the best of my knowledge you can't use a colon ':' in a filename.  I suspect that is why its replacing it with an underscore '_'

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,526

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard