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 / formatdatetime(utcnow)
Power Automate
Answered

formatdatetime(utcnow)

(4) ShareShare
ReportReport
Posted on by 53

Hi all

 

I have a field called Date on my sharepoint list - and my flow is sending a email when that date is equel to Today date but it fail all the time as Date field is not formating in dd-MM-yyyy but in other format

 

my field is like this where weeks is my field name who contain the date like 30-08-2018

 

formatdatetime(triggerBody()?['weeks'],'dd-MM-yyyy') (but this fail)

 

but this one work when i try to take the Today date

formatDateTime(utcNow(),'dd-MM-yyyy')

Thanks

Categories:
I have the same question (0)
  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @BR1984:

     

    Can you post a screen shot of your Flow so that we can better assist?

     

    Scott

  • BR1984 Profile Picture
    53 on at

    Skærmbillede 2018-08-30 kl. 20.20.49.png

    Yes i can

     

    I try to use compose to format the value of Sharepoint list who contain the date but the formating i output is wrong

    the compose 1 when i format utcnow to dd-mm-yyyy is working great but its seems like its not the same when it comes from a list ?

    The date who comes from sharepoint list is a calculated date column but the Microsoft Flow is reading that null ?

    i dont get it - hope some one can help me 

     

  • MarkStokes Profile Picture
    561 on at
    SharePoint dates are UTC formatted.

    Have you tried formattting the date as “yyyy-MM-dd”?
  • BR1984 Profile Picture
    53 on at
    Yes i have but it cant format it - the format is the function I write, I have try it with @ and without.
  • v-yamao-msft Profile Picture
    on at

    Hi @BR1984,

     

    Which trigger are you using?

     

    Do you want to get all the items first then find out the one which Week is equal to Today?

     

    I have made the following test on my side, please take it for a reference.

     

    The flow is triggered by a Button. Then Get items from the list.

     

    Compose2 is used to format utcnow with the following code:

    formatDateTime(utcNow(),'MM-dd-yyyy')

     

    Compose is used to format Week, just make sure put it under action Apply to each.

    formatDateTime(items('Apply_to_each')?['Week'],'MM-dd-yyyy')

     

    If they have the same date, send a notification.

    1.PNG

     

     

    Best regards,

    Mabel Mao

  • BR1984 Profile Picture
    53 on at

    Thanks for replay

     

    i have just try it and i get a error

    InvalidTemplate. Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2507': '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.'.

     

    it seems like calculated column who called Weeks is null - but it not true the value is 31-08-2018.

     

     

  • v-yamao-msft Profile Picture
    on at

    Hi @BR1984,

     

    Thanks for updating with more details.

     

    Yes, Calculated column is currently not supported. So you will get the error message.

     

    Please try to use a column of type date and time, which should work.

     

    Best regards,

    Mabel Mao

  • Verified answer
    BR1984 Profile Picture
    53 on at

    Hi v-yamao-msft Thanks for that but its not true

     

    I took the calculated column and convertet it with Date function and everythings work fine.

     

    Thank for replay.

     

     

  • whitelc Profile Picture
    36 on at

    Can you tell me how you converted the SharePoint calculated column to a date in Flow? I cannot get calculated dates from SharePoint list to format properly in a Flow-generated email.

     

    I've tried various permutations of "formatDateTime" and get the same error others have mentioned: 

     

    Unable to process template language expressions in action 'Compose_-_format_Hire_Date_+_3_Months' inputs at line '1' and column '2540': 'The template language function 'formatdatetime' expects its first parameter to be of type string. The provided value is of type 'Null'.

     

    Thanks!

  • Community Power Platform Member Profile Picture
    on at

    Generaly If you have in the flow date from UtcNow and expression calculates date you have to update item which column is formated as date. You have to open SharePoint list and go to the setting of the column.

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

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard