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 / Disabled button after ...
Power Apps
Unanswered

Disabled button after click

(0) ShareShare
ReportReport
Posted on 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:
I have the same question (0)
  • WiZey Profile Picture
    3,023 Moderator on at

    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.

  • davidmckenzie Profile Picture
    25 on at

    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() );

  • JimboSey Profile Picture
    321 on at

    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 at

    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.

     

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard