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 / Activating buttons on ...
Power Apps
Unanswered

Activating buttons on specific dates

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

I'm building a Power App that includes buttons. When clicking the button, users should be taken to a designated screen.

 

I'd like for each button to be clickable only on a specific date, e.g. button 1 is clickable on December 1, button 2 on December 2, button 3 on December 3, etc.

 

If users click on the button before that specific date, they should receive a pop-up, telling them to return to the app later. If they click on it after that specific date, they should be redirected to the designated screen.

 

I'm struggling with writing a function for these scenarios. Would you be able to help me?

 

Thanks,

Anne 

Categories:
I have the same question (0)
  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    Hi @anne_danko ,

     

    Include on OnSelect property of each button something similar to:

    If(Today()>=DateValue("23.11.2020"), UpdateContext({viewPopUp:true}), Navigate(DesignatedScreen))

        - where viewPopUp is used to control the popup visibility.

    To build a pop-up it is indicated to use a rectangle control in front of all others controls (to avoid accidental select of other controls) and a Label containing the message. Set the Visible property of both control to popUpView.

     

    Also , you can control the option that the user have by using DisplayMode property and set it on each button to something similar to:

    If(Today()>=DateValue("24.11.2020"),DisplayMode.Edit,DisplayMode.Disabled)

    In this way all buttons before Today() will  be shown, but disabled.

     

    Hope it helps !

    I think  this solve also your issue

     

  • anne_danko Profile Picture
    Microsoft Employee on at

    Hi @gabibalaban,

    Thanks for getting back to me so promptly. I'm a complete rookie and still unsure about this part of the formula:

     

    =DateValue("23.11.2020")

     

    • Is this the date I'm assigning to a particular button?
    • I read that the today function works with the local time of the user. If the user has a different time setting on their device, e.g. DD/MM/YYYY instead of MM/DD/YYYY, will this result in the button not working?

     

    Thanks a lot for your help, it is much appreciated.

  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @anne_danko ,

     

    1. Yes, you're right. The date is specific for every particular button.

    2. Yes, you're right again. I'm from Europe. The button will still work, but the result of the function will not be as expected. 

    Example: DateValue("23.11.2020")   in Europe:   23rd November 2020

                                                              in US:          11th November 2021.

     

  • anne_danko Profile Picture
    Microsoft Employee on at

    Thanks a lot, @gabibalaban. I have one final question regarding the pop-up. Should the Visibility property be "popUpView" or "viewPopUp"? And where do I set the visibility property? 🤔

  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    Uf ... i really messed up the post. Of course is the same variable.

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

#2
11manish Profile Picture

11manish 193

#3
Valantis Profile Picture

Valantis 138

Last 30 days Overall leaderboard