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 : 5Vv+u7e2JpH0RSEpLvvvx9
Power Apps - Building Power Apps
Unanswered

Disabled button after click

Like (0) ShareShare
ReportReport
Posted on 24 Mar 2023 13:25:19 by 321

Hi there, 

I have an App used by lots of users, and on one of the screens, I have a button which basically uses Flow to attach data to the user profile on click of the button. 

Problem I am having is, some users are hitting the button twice, sometimes more and its running the flow and duplicating the info.

I would like a simple way of disabling the button once its clicked so avoid duplication. 

Initially I applied the following, 

 

On the button OnSelect I have Set(varButtonPressed, true)
And then in the DisplayMode property code is If(varButtonPressed,DisplayMode.Disabled, DisplayMode.Edit)

This works, but of course only the one time, and as many users use the App, I need it to be available for anyone who hasnt already pressed the button. 

Any ideas how I can achieve this?

Thanks

Categories:
  • davidmckenzie Profile Picture
    25 on 24 Mar 2023 at 15:39:56
    Re: Disabled button after click

    This would be in the same place you are currently running the flow from, which I guessing will be an OnSelect for a button. And any code (like Navigate) after the Set() would happen after the flow is complete.

     

  • JimboSey Profile Picture
    321 on 24 Mar 2023 at 15:33:42
    Re: Disabled button after click

    Thanks, 

    So I would apply this to OnSelect of the button? And if I say have Navigation after this, would it wait while the Flow is complete to Navigate? Thanks

  • davidmckenzie Profile Picture
    25 on 24 Mar 2023 at 15:24:42
    Re: Disabled button after click

    If you set a variable to the value of the flow run, the app waits for the flow to complete before giving control back to the user, something like:

    Set(varFlowResult, MyFlow.Run() );

  • WiZey Profile Picture
    3,023 Moderator on 24 Mar 2023 at 14:01:23
    Re: Disabled button after click

    Hello @JimboSey ,

     

    One way I achieved something similar was by storing the variable as a record in a SharePoint list.

     

    When the flow starts, it checks if the record is equal to "start" or something. 

     

    If it was different than "start", the flow updated the record to "start" then continued to process its things. Until the end, where the record was updated to "not started".

     

    If it was equal to "start", it meant the flow was already started by someone else and it must not continue.

     

    Hope this was helpful to you.

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete