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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Invalid expression - f...
Power Automate
Unanswered

Invalid expression - format date time

(0) ShareShare
ReportReport
Posted on by 10

Hi, 

 

I have a folder that creates a project folder in SharePoint when a project is added to a project list in SharePoint. I am trying to name the project folder with [Start Date] [Project Title] - but want to format the Start Date with yyyyMM. Trying this expression: 

 

formatDateTime(['triggerOutputs()?['body/Start_x0020_Date']'],'yyyyMM')
 
But gets that it is invalid. Anyone who can help? 
 
Thanks!! 
Linn1_1-1696339041293.png

 

Linn1_0-1696338981370.png

 

Categories:
  • Michael E. Gernaey Profile Picture
    53,970 Super User 2026 Season 2 on at

    Hi,

     

    Couple of things.

    1. Can you share the run, with the error, also showing the input and outputs of the action with the error.

    2. If your field is a Date (a true date), then you have to wrap it in string() as the first parameter is a string, not a date

    formatDateTime(string(['triggerOutputs()?['body/Start_x0020_Date']']),'yyyyMM')


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • Linn1 Profile Picture
    10 on at
    Hi, I tried to wrap the date in a string () but I am still getting the error. I have not tested the run with the expression because it not allows me to save it as the "expression is invalid". 
  • Michael E. Gernaey Profile Picture
    53,970 Super User 2026 Season 2 on at

    Hi,

     

    I am still not even sure which Action is giving you the issue. Can you please post a picture that clearly shows which one it is.

     

    Please be super clear. Show every value that you are typing in, if its the Compose folder name.

    And if you take out the Date part you are trying to add, do  you still get the expression error or does it go away?

    I am assuming you typed it in the Expression window and then switched to the Dynamic to add the Property?


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 227 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 132

Last 30 days Overall leaderboard