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 / 'The template language...
Power Automate
Unanswered

'The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'.

(0) ShareShare
ReportReport
Posted on by 15
formatDateTime(utcNow(),'yyyy-MM-dd')

Is Equal To:

formatDateTime(triggerbody()?['Created'],'yyyy-MM-dd')
 
... where Created is a Sharepoint List default field of the same name.
 
Where is my syntax wrong?
Categories:
I have the same question (0)
  • tom_riha Profile Picture
    10,185 Most Valuable Professional on at

    Hello @AscendCOE ,

    the triggerbody()? part seems wrong, try to use:

    triggerOutputs()?['body/Created']
  • AscendCOE Profile Picture
    15 on at

    Hello @Anonymous 

    I recieved the same Error:

     

    InvalidTemplate. Unable to process template language expressions for action 'Condition' 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.'.
     
    formatDateTime(utcNow(),'yyyy-MM-dd') Is Equal To formatDateTime(triggerOutputs()?['body/Created'],'yyyy-MM-dd')
     
    Do you have any other thoughts? Should the functions be reversed?
  • MJain Profile Picture
    2,450 on at

    Hi @AscendCOE ,

     

    I suggest you use compose action and put triggerOutputs()?['body'] in expression to see what is the output you are getting . If you get created field in this then you are good to use but check the output properly if you are looking for something else .

     

    Thanks

  • AscendCOE Profile Picture
    15 on at

    Hi @ManishJain 

     

    I ran a compose on the function: 

    "formatDateTime(triggerOutputs()?['body/Created'],'yyyy-MM-dd')"
     
    And the output was the same as the function. Based on your previous statement you're suggesting I am not referencing the field properly?
  • MJain Profile Picture
    2,450 on at

    Hi @AscendCOE ,

    possibly yes , that is where if you do compose action and put triggerOutputs()?['body'] it will give you all fields to look at . Once you are able to figure it out remove this compose action and put it in formatDateTime .

     

    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 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard