web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / If condition says fals...
Power Automate
Unanswered

If condition says false even though it's true?

(0) ShareShare
ReportReport
Posted on by 503

Hi all 

 

I have a variable that outputs this time/date: 

Syntax of variable:

 

 

 

if(empty(items('Apply_to_each_Employee')?['dlg_defaultstarttime']), 'Empty',concat(utcNow('yyyy-MM-dd'), ' ', formatdateTime(items('Apply_to_each_Employee')?['dlg_defaultstarttime'], 'HH:mm')))

 

 

 

Time/date output:

Capture432332.JPG

 

I also have a convert time function outputting this date/time (my current date/time): 

Capture43221.JPG

Capture422.JPG

So as you can see above, the variable is holding my specified 'date/21:00' and 'convert time' is my local current date/time. 

 

The condition below keeps resulting in false when it should be true in this case because the Var time is greater than current time: 

 

Capture121.JPG

 

Capture3232.JPG

 

I have a feeling the date format is not matching correctly, so can someone help me correct it so I can get the condition working?

 

Any help is appreciated. 

 

Kind regards. 

 

Categories:
I have the same question (0)
  • tom_riha Profile Picture
    10,185 Most Valuable Professional on at
    Re: If condition says false even though it's true?

    Hello @Usernametwice23 ,

    I'd try to format the two dates into the same format. One of them is 

    yyyy-MM-dd HH:mm

    The other one is

    yyyy-MM-ddTHH:mm

    I can imagine that the missing/extra T could cause a problem.

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
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard