Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

What could be causing my format date and time to fail?

(1) ShareShare
ReportReport
Posted on by

So in the excel file itself the end date is formatted as dd/mm/yyyy and does have something in the cell 26/07/2024

In list rows present in table I have the date time format set to ISO 8601 

 

and in the email I am sending I am using the following expression

 

formatDateTime(triggerOutputs()?['body/{Worker End Date}'], 'MM-dd-yyyy'
 

When I run the bot however on the send email v2 step I get the following error:

 

InvalidTemplate. Unable to process template language expressions in action 'Send_an_email_(V2)_2' inputs at line '0' and column '0': 'The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'.

 

 

If I don't use an expression the result in the email I get is 2024-07-26T00:00:00.000Z

What can I do to fix this?

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: What could be causing my format date and time to fail?

    Hi @rmartori 

     

    It looks like the property 'Worker end date' does not exist in output body of trigger.

     

    Please select dynamic date value from dynamic content window & pass it in the below expression:

    formatDateTime(<select date value from dynamic content window>'MM-dd-yyyy'

     

     

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492