0

I am trying to figure out why my conditional equates to false for both items that get returned despite them being equal.

My conditional is as follows

formatDateTime(items('Apply_to_each')?['DueDateCalculated'],'yyyy-MM-dd') is equal to

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

As you can see in the picture attached the values are equal and in the correct format but it results in a false. I am out of ideas other than setting those both to variables.

enter image description here

OMGDrAcula
  • 1,054
  • 3
  • 11
  • 17
  • 1
    Throw a `string()` expression around the two values and see if that helps in the comparison. – Skin Jan 19 '22 at 01:19

1 Answers1

0

The values are not equal because there is a hidden hh:mm:ss.SSS component inside each date variable, which you don't take into account.

It is not really obvious from the screenshot provided what values you are comparing with one another, but addDays(utcNow(),54) just can't be equal to ['DueDateCalculated'], because at least one of them has hh:mm:ss.SSS component in it.

J-M
  • 1,207
  • 11
  • 18
  • So even though I use the format date on both it still has the hidden time items? I am comparing the two expressions they are not set to variables. Which could be the issue. – OMGDrAcula Jan 19 '22 at 01:25