Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Birthday Automation

(0) ShareShare
ReportReport
Posted on by 10

Hi can someone help me out, as getting error as "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 'Array'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'."

attached screenshot for reference.

 

1)

MImran_2-1688627737635.png

2)

MImran_3-1688627871148.png

 

What I actually selected the format in Condition

 

MImran_0-1688627613569.png

 

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at
    Re: Birthday Automation

    You have a NULL value in one of the dates that you are trying to format. Since one of them is the one you're calculating with utcNow(), I assume it's the one from your inputs that is null. You can handle that with a separate condition before your Compose activity where you check if the item is not null. There is an expression for NULL - you can use that.

     

    A null date means it's empty, so you should act accordingly to your use case when that happens, but you cannot really do a comparison on that.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution.
    If you like my response, please give it a Thumbs Up.

    If you are interested in Power Automate, you might want to follow me on LinkedIn at https://www.linkedin.com/in/agnius-bartninkas/

     

  • MImran Profile Picture
    10 on at
    Re: Birthday Automation

    as per the above one put the everything same but no luck.

     

    MImran_1-1689026101879.png

     

     

    MImran_0-1689025966190.png

     

  • v-xiaochen-msft Profile Picture
    on at
    Re: Birthday Automation

    Hi @MImran ,

     

    Please use 'Apply_to_each' here.

    vxiaochenmsft_0-1688951350952.png

     

    Best Regards,

    Wearsky

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at
    Re: Birthday Automation

    You do not need the Compose action there. You're not using it anyway, as far as I can tell.

     

    As for the other error, it is a different one. It says the date you are trying to convert is not recognized as a date, because it is in an unsupported format. Can you share what the dates look like in your inputs?

     

  • MImran Profile Picture
    10 on at
    Re: Birthday Automation

    Hi,

    Getting the error again to run a flow

     

    MImran_2-1688739720260.png

     

     

    MImran_3-1688739785334.png

     

  • MImran Profile Picture
    10 on at
    Re: Birthday Automation

    Getting the same error after updating

     

    MImran_0-1688738931592.png

     

     

     

    MImran_1-1688739016901.png

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at
    Re: Birthday Automation

    I would argue that the compose is probably not even necessary at all. The expression suggested above can be used directly in the formatDateTime() expression resulting in formatDateTime(items('Apply_to_each')?['DateColumnName'],'MM/dd') for the first operand.

     

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution.
    If you like my response, please give it a Thumbs Up.

    If you are interested in Power Automate, you might want to follow me on LinkedIn at https://www.linkedin.com/in/agnius-bartninkas/

     

  • v-xiaochen-msft Profile Picture
    on at
    Re: Birthday Automation

    Hi @MImran ,

     

    Thanks for the clarify.

    The value of the compose is wrong.

    It seems that you have a date column in SharePoint list, and you want to compare it with utcnow(), right?

    If my guess is right, please use items('Apply_to_each')?['DateColumnName'] here.

    vxiaochenmsft_0-1688692991251.png

     

    Best Regards,

    Wearsky

  • MImran Profile Picture
    10 on at
    Re: Birthday Automation

    thank you for the respond, here the screenshots.

     

    for the 1st one is

    formatDateTime(outputs('compose'),'MM/dd'

    MImran_2-1688681433302.png

     

     

    2nd one is

    formatDateTime(utcNow(),'MM/dd')

     

    MImran_3-1688681433308.png

     

     

  • MImran Profile Picture
    10 on at
    Re: Birthday Automation

    thank you for the respond, here the screenshots.

     

    for the 1st one is formatDateTime(outputs('compose'),'MM/dd'

    MImran_0-1688681173173.png

     

    2nd one is formatDateTime(utcNow(),'MM/dd')

     

    MImran_1-1688681230897.png

     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June 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 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1