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)
2)
What I actually selected the format in Condition
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/
as per the above one put the everything same but no luck.
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?
Hi,
Getting the error again to run a flow
Getting the same error after updating
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/
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.
Best Regards,
Wearsky
thank you for the respond, here the screenshots.
for the 1st one is
formatDateTime(outputs('compose'),'MM/dd'
2nd one is
formatDateTime(utcNow(),'MM/dd')
thank you for the respond, here the screenshots.
for the 1st one is formatDateTime(outputs('compose'),'MM/dd'
2nd one is formatDateTime(utcNow(),'MM/dd')
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1