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.

(0) ShareShare
ReportReport
Posted on by 920 Super User 2024 Season 1

Hi,

 

I am trying - formatDateTime(item()?['ConclusionDate'],'mm/dd/yyyy')

 

But getting error - 

Unable to process template language expressions in action 'Send_an_email_(V2)' 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'

 

where am I going wrong?

Categories:
I have the same question (0)
  • v-yetonggu-msft Profile Picture
    on at

    Hi @wonka1234 ,

    Because there is a null value in your 'ConclusionDate' column, flow will report an error.

    Please try this expression:

     

    if(empty(item()?['ConclusionDate']),null,formatDateTime(item()?['ConclusionDate'],'mm/dd/yyyy'))

     

    Best Regards,

    Sunshine Gu

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    Thanks @v-yetonggu-msft  . No error now, but now the body of the email is showing blank lol.

    But I see in update item :

    wonka1234_0-1702950868826.png

     

     

    But no value is showing with your expression in the email body.

  • v-yetonggu-msft Profile Picture
    on at

    Hi @wonka1234 ï¼Œ

    Please show a complete screenshot of your flow.

    Best Regards,

    Sunshine Gu

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    @v-yetonggu-msft  Not sure if this helps..

     

    wonka1234_0-1702951216658.png

    wonka1234_1-1702951291129.png

     

  • v-yetonggu-msft Profile Picture
    on at

    Hi @wonka1234 ,

    It’s useless. What are the steps before your flow?

     

    Best Regards,

    Sunshine Gu

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    @v-yetonggu-msft  nothign much related to ConclusionDate happens.

     

    wonka1234_0-1702952763267.png

    Date is related to the other date field in the email.

  • Verified answer
    v-yetonggu-msft Profile Picture
    on at

    Hi @wonka1234 ,

    This information is enough, please try this expression:

     

    formatDateTime(body('Update_item')?['ConclusionDate'],'MM/dd/yyyy')

     

    Best Regards,

    Sunshine Gu

  • Ry009_ Profile Picture
    109 on at

    Hi

    I tried a modifed version of your suggestion, but it's returning nulls, not sure what I'm doing wrong?

     

     

    if(empty(item()?['_Table[Datefield]']),null,formatDateTime(item()?['_Table[Datefield]'],'dd/MM/yyyy'))

     


    This is my flow with the expression in the compose step;

    Ry009__0-1719376030370.png

     

    Not sure what I'm doing wrong?

     

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard