Compare Dates in Logic App condition block

Pavan G 186 Reputation points
2021-11-15T15:35:19.867+00:00

Hi Experts,

I have a requirement in LogicApp where I need to compare the date and proceed to the next step only if it is true.
Compare date from the Source XML which is picked from ASB against the date is which is picked from the Azure table storage.

149445-image.png
Date format from XML: YYYY-MM-DD
Date format from Azure Table STorage: MM/DD/YYYY

For testing the condition block I set the date format from XML to MM/DD/YYYY and used the dynamic expression like
formatDateTime('body('Get_entities')['value'][0]['Date']','yyyy-MM-dd')

Logic App is throwing the error as below.
149446-image.png

My case is similar to: https://stackoverflow.com/questions/54806424/how-to-check-the-greater-than-in-condition-block-in-azure-logic-app. But there is no answer for this query.

Any help would be of great help.

Regards,
Pavan

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,349 questions
0 comments No comments
{count} votes

Accepted answer
  1. Nasreen Akter 10,811 Reputation points
    2021-11-15T20:59:02.007+00:00

    Hi @Pavan G ,

    Would you please try formatDateTime(body('Get_entities')?['value'][0]?['Date'], 'yyyy-MM-dd') instead of formatDateTime('body('Get_entities')['value'][0]['Date']','yyyy-MM-dd').

    Thanks!

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.