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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Automatically Enable &...
Power Apps
Answered

Automatically Enable & Disable Button based on Time interval.

(0) ShareShare
ReportReport
Posted on by 527

Hi

knsrinath_0-1667103878046.png

I have tried Time Now(). But it is not working automatically

 

Request you help me to achieve this.

 

Thanks & Regards 

Categories:
I have the same question (0)
  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi @knsrinath 

     

    try this in the Display mode of your button.

     

    DisplayMode = 

    With(
     {_eval: Hour(Now())},
     If(
     (_eval >= 6 && _eval <= 9) || (_eval >= 16 && _eval <= 18),
     DisplayMode.Edit,
     DisplayMode.Disabled
     )
    )

     

    R

     

  • knsrinath Profile Picture
    527 on at

    Hi @rubin_boer 

     

    When I'm editing the code it is working. But In Playmode it is not working.

     

    Thanks & Regards

     

  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi @knsrinath at what interval would you like to do the check, minute second etc. you can have the timer duration at 60000 have the OnTimerEnd  = UpdateContext({_eval: Hour(Now())}) and have the if statement in the display mode 

    If(
     (_eval >= 6 && _eval <= 9) || (_eval >= 16 && _eval <= 18),
     DisplayMode.Edit,
     DisplayMode.Disabled
    )

    this will check the status every minute.

     

    Will this screen be open all the time?

     

    R

  • Verified answer
    knsrinath Profile Picture
    527 on at

    Hi @rubin_boer 

     

    I have created a variable on the Button Display 'varStop' & OnTimerEnd 

     

    Set(varStop,
    With(
     {_eval: Minute(Now())},
     If(
     (_eval >= 8 && _eval <= 10) || (_eval >= 52 && _eval <= 55),
     DisplayMode.Edit,
     DisplayMode.Disabled
     )
    ))

    It is working fine.

    Thanks for your support.

     

    Thanks & Regards

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#2
11manish Profile Picture

11manish 192

#3
Valantis Profile Picture

Valantis 128

Last 30 days Overall leaderboard