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 / Need help with timer t...
Power Apps
Unanswered

Need help with timer to show orange color 15 min before timer runs out

(0) ShareShare
ReportReport
Posted on by

Hello!

 

Today I got a working code to make my label turn either red (Exceeds time) or green (Before time) depending if the date/time in the label exceeds the Now() value.

 

But I also want the label to be able to turn orange if its 15min until the timer runs out. Is this possible?

 

I got this code:

If(IsBlank(ThisItem.'Last Contact');RGBA(0;0;0;0);
If(ThisItem.'Last contact'<= thecolor;RGBA(242;38;19;1);RGBA(0;255;42;45)))

 

The timer "thecolor":

Set(thecolor; Now())

 

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    on at

    Hi @Anonymous :

    I am not sure if my understanding is correct, please help me point it out if there is an error.

    • There is a timer control, when you click on it, it will time for 15 minutes.
    • When the timer control is timing, you want the text in the label to be orange.
    • When the timer control is over, you want the text in the label to be red or green.

    If so ,Please try this :

    Step1:Set the app's OnStart Property to:

     

    Set(Orange;true) /*Orange is my custom variable*/

     

    Step2:Timer——

    Duration

     

    900000 /*15min*/

     

    OnSelect

     

    Set(Orange;true) /*Orange is my custom variable*/

     

    OnTimerEnd

     

    Set(thecolor;Now());;Set(Orange;false)

     

    Step3:Label——

    Color

     

    If(
     Orange;
     Color.Orange;
     If(
     ThisItem.'Last contact' <= thecolor;
     RGBA(242;38;19;1);
     RGBA(0;255;42;45)
     )
    )

     

    69.gif

    Best Regards,

    Bof

  • Community Power Platform Member Profile Picture
    on at

    @v-bofeng-msft Hello!

     

    Thanks for your reply, I really appreciate your help.

     

    This is not exacly what i'm asking for. I will try to explain better.

     

    The timer control is not a clickable button, its on repeat every second to check if the time i've inserted into the labels is before or past the current time now().

     

    If I set the time on the label to 2020-08-26 09:00 and the current time is 2020-08-26 08:00 it will display the color green, if the current time is past 2020-08-26 09:00 it will display red.

     

    What I want in this scenario is if the current time is 2020-08-26 08:45 it will display the color orange in the label because its 15 min left until the set time in the label, and when it past 2020-08-26 09:00 it will display the color red.

     

  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @Anonymous :

    Please try :

    If(
     DateDiff(thecolor;ThisItem.'Last contact';Minutes)<15
     &&
     DateDiff(thecolor;ThisItem.'Last contact';Minutes)>0;
     Color.Orange;
     If(
     ThisItem.'Last contact'<=thecolor;
     RGBA(242;38;19;1);
     RGBA(0;255;42;45)))

    Best Regards,

    Bof

     

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard