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 / How can I disable butt...
Power Apps
Answered

How can I disable button once user summitted the data?

(0) ShareShare
ReportReport
Posted on by 26

My scenario: I am preparing a form where on view list approver have three button 'approve' ,'reject' ,'edit'   .

I am getting error invalid use of button 

On clicking approve /reject data is updated in SharePoint, but I want to disabled it from next view onwards and on clicking edit button approver only have a form view list not edit .

Waiting for a solution .trying different methods by reading blogs and YouTube views but no results . If any one from community help me it will be great and thanks in advance 

 

 

 

Community.PNG
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,293 Most Valuable Professional on at

    Hi @Powerquery ,

    It appears you have a gallery there and I assume the buttons are in this gallery. You have not shared the code you are getting an error, so please do this (in text). As far as the View Mode, you will need to have a field (Status would be a good name) in your list that you update when the button is actioned and then base the mode of the form on the value of this field.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Powerquery Profile Picture
    26 on at

    If(ThisItem.Status.Value="Approved",DisplayMode.Disabled,DisplayMode.Edit) .I am using this formula and getting error as invalid use of display button. in the question i have attached the my view screenshot . 

    Thanks for replying 

  • WarrenBelz Profile Picture
    155,293 Most Valuable Professional on at

    Hi @Powerquery ,

    Your formula 

    If(
     ThisItem.Status.Value="Approved",
     DisplayMode.Disabled,
     DisplayMode.Edit
    ) 

    would be valid on the DisplayMode of the Button providing

    • You had a Choice field called Status in your list AND
    • The button was in the gallery containing this record.

     What is not correct here?

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • Powerquery Profile Picture
    26 on at

    Hi @WarrenBelz , Thanks for response. my apologies , my question is first in the gallery form first the approver will approve the concerned form using Approve button .once that will happen after that no one should change the status in sharepoint and that approve button should disabled ,is that possible ? First I am using the Patch function to change the form status and then want to change the button to disable.

  • WarrenBelz Profile Picture
    155,293 Most Valuable Professional on at

    @Powerquery ,

    As I posted the formula on the DisplayMode of the button

    If(
     ThisItem.Status.Value="Approved",
     DisplayMode.Disabled,
     DisplayMode.Edit
    ) 

    will disable the button the moment the Status field in the record is updated to Approved. You can base the behaviour of any other control in the gallery or action initiated by it on the value of Status. Is that what you are asking?

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • Powerquery Profile Picture
    26 on at

    But for me  it worked without using .value  and button disabled .

    If (
    ThisItem.Status = "Approved",
    DisplayMode.Disabled,
    DisplayMode.Edit
    )

    Thanks for the input. Could you tell me is there any way to change the button text like on disable the text button should change to  Approve to Approved ? or from blue color button to green .

  • WarrenBelz Profile Picture
    155,293 Most Valuable Professional on at

    @Powerquery ,

    I copied the .Value from your code assuming it was a Choice field. If Status is a Text field, then you do not need .Value. For the button Text, put on the Text property

    If(
     ThisItem.Status="Approved",
     "YourFirstTextHere",
     "YourSecondTextHere"
    ) 

    and the Color

    If(
     ThisItem.Status="Approved",
     Red,
     Blue
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • Verified answer
    WarrenBelz Profile Picture
    155,293 Most Valuable Professional on at

    Hi @Powerquery ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Powerquery Profile Picture
    26 on at

    @WarrenBelz , Thanks for the response , like if you remember i am using a form to approve and reject button ,is there a way where I can use drop down list of approve or reject and once the action taken the drop down list will be disabled for the approver and color can be changed to green on approve and other call on reject . instead of different approve and reject button .Attached the snippet of my form .

    Community.PNG
  • WarrenBelz Profile Picture
    155,293 Most Valuable Professional on at

    HI @Powerquery ,

    You can use the same logic for the color of the button (ThisItem.Status = "Approved")

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,033

#2
Valantis Profile Picture

Valantis 632

#3
11manish Profile Picture

11manish 607

Last 30 days Overall leaderboard