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 / Disable the button whe...
Power Apps
Answered

Disable the button when the flow is correctly triggered.

(0) ShareShare
ReportReport
Posted on by 13

Hi all,

 

I would like to know if there is a method to disable the button when the PowerAutomate flow combined with that button is correctly triggered.

 

To be more specific, I have a button that will trigger a flow to add an item in the SharePoint List. However, I just want the users to click on that button once a day. Otherwise, if they click too much times, there will be huge amount of duplicated list item added to the SP list, which is not what I want. 

Hope there is a solution on this.

 

Or is there any way to display the flow status in the PowerApp? For example, after the user click on the button, it will tell them the flow is triggered correctly. So they don't need to click on the button multiple times.  

Categories:
  • PaulD1 Profile Picture
    2,914 on at

    Your Flow can return a value to Power Apps when completed (Respond to PowerApps action) so you can use that to determine if the Flow ran successfully (the response becomes the output parameter of the call to your flow so you can do something like UpdateContext({conFlowComplete: YourFlow.Run(parameters).OutPutParameter}).

    However, it sounds like you have multiple users who might not be aware that another user may have run the flow today, so I think you would be better with a table that holds just the Dates on which the Flow has been run (the Flow can populate a row with the current date once it has run successfully) - you can then set the Displaymode property of the button to the outcome of a LookUp to see if today's date has been recorded in that table (and also check in the OnSelect in case the datasource has not been refreshed since the table was updated).

    If your Flow takes a while to run you will still run the risk of user A running the Flow and, before the Flow has finished, user B also running the Flow (flows can run simultaneously). You can add more code to try to prevent such scenarios but they might be so rare you don't need to bother.

  • Alexadmin21 Profile Picture
    13 on at

    Hi Paul,

     

    Thanks so much for your suggestions.

    I was thinking ask the power automate to return a value to PowerApps.

    Alexadmin21_0-1620895390009.png

     

    And change the visibility of the app button based on the value returned. 

    Is it possible? If so, could you direct me how to configure the visibility with formula?

     

    TIA

  • Verified answer
    PaulD1 Profile Picture
    2,914 on at

    In the OnSelect of your button, use code along the lines of:

    UpdateContext({conFlowComplete: YourFlow.Run(parameters).Success}

    This should run the flow and assign the result to the context (screen specific) variable 'conFlowComplete'.

    In the Displaymode of your button you would use:

    If(conFlowComplete = "Yes", Displaymode.Edit, Displaymode.Disabled)

    Hope that helps.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard