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 Apps - Building Power Apps
Suggested answer

Button ONSELECT event not triggering correctly?

(1) ShareShare
ReportReport
Posted on by 14
Hi, 
 
I have a button that executes the following:      Button click > Automate Flow > SQL stored proc > SQL Agent Job > does some stuff on some on prem servers.
 
Nothing is returned, its just a click and go for the user.  
 
I just want to stop the user from constantly pressing the button, just to click once.
 
I have tried, visible onselect = false.
 
display mode = disabled
 
and even a container that sits in front of the button.
 
Nothing seems to work.
 
Just wondering what someone else would do in this scenario?
 
 
 
Categories:
I have the same question (0)
  • Suggested answer
    tmoore1 Profile Picture
    23 on at
    Button ONSELECT event not triggering correctly?
    Create a variable ('varBtnClick') that initializes with the app 'OnStart', or when the main screen appears 'OnVisible', or a gallery item is selected 'OnSelect', or some other trigger, and set its value to 'false'.
     
    Set(varBtnClick, false);
     
    At the top of the OnSelect parameter of your button, set the variable to 'true'.
     
    Set(varBtnClick, true);
    The rest of your button logic goes here;
     
    In either the 'Visible' or 'DisplayMode' parameter of the button, use an 'If' statement to change its value based on the variable.
     
    // Visible
    If(!varBtnClick, true, false)
     
    // DisplayMode
    If(
        !varBtnClick,
        DisplayMode.Edit,
        DisplayMode.Disabled
    )

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

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 651 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 385 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 230 Super User 2025 Season 2

Last 30 days Overall leaderboard