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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Operating time columns
Power Apps
Answered

Operating time columns

(0) ShareShare
ReportReport
Posted on by

Hi Guys,

 

I am currently developing and App that is suposed to highlight and show some boxes according to the current time.

 

For instance, if it is 12:30, Boxes number 2 and 3 must turn Yellow up to 13:00 when they turn Red up to 13:30 when they disappear.

 

The logic behind it seems easy except for the part that I am not being able to do the "Math". Is it possible ?

 

Best Regards

Categories:
I have the same question (0)
  • Verified answer
    CarlosFigueira Profile Picture
    on at

    If I understand your problem correctly, you want to have two boxes that will appear between 12:30 and 13:00 (as yellow), 13:00 and 13:30 (as red) and not show up in other times of the day... If this is the case, then you can use an expression like the following in the Fill and/or Color property of your control:

    If(
     Hour(currentTime) = 12 And Minute(currentTime) >= 30; Color.Yellow;
     Hour(currentTime) = 13 And Minute(currentTime) < 30; Color.Red;
     Color.Transparent)

    Where 'currentTime' is a variable that you can update based on a timer. For example, if you add a timer to your screen, and set the properties below with the following values:

    Duration: 10000
    Repeat: true
    AutoStart: true
    AutoPause: false
    OnTimerEnd: Set(currentTime; Now())

    Then  when your app is in the screen where your boxes are shown, the value of 'currentTime' will be updated every 10 seconds with the current time, and that will change the color of the boxes if the time crosses one of the thresholds.

    The attached app shows this logic. I've also added a button where you can "override" the current time for a while (until the timer is triggered again) so you can test your logic in other times of the day. To open it, save it locally, then go to https://create.powerapps.com, select Open, Browse, then find the file that you saved before.

    Hope this helps!

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard