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 to show a button b...
Power Apps
Answered

How to show a button based on if you are in add mode or edit mode

(0) ShareShare
ReportReport
Posted on by 30

What i would like to do is show a button if the using is adding a record, if it is not hide the button. Do you have any ideas how i can do an if state to check that status and then hide a button based on that status. Thanks

Categories:
  • Meneghino Profile Picture
    6,949 on at

    What do you mean by "if the using is adding a record"?

     

    In any case you can set statuses with the UpdateContext command such as UpdateContext({UserAdding: true})

     

    Then you can set the visibility of the button (its Visible property) to = UserAdding

     

    That will work.

     

    PS You can also leave the button visible but set Disabled to = !UserAdding

  • Verified answer
    Abdou Profile Picture
    Microsoft Employee on at

    The Form control has a "Mode" property, which tells you whether the form is in Edit mode, or New mode.

    You can set your button's Visible (or Disabled) accordingly. For example:

     

    Form1.Mode = FormMode.Edit

    Hope this helps 🙂

  • ElleVee Profile Picture
    30 on at

    Yes, this helps. I will try it. Thank You for your quick response.

  • ElleVee Profile Picture
    30 on at

    By the way. I tried it and it works perfectly. Again Thanks.

  • Lebogang1 Profile Picture
    2 on at

    Hi there

    What if I want the button to be visible when Form1Mode = FormMode.Edit & when FormMode.New? It gives me an error when I try to combine the two formulas

     

  • Sidhant_02 Profile Picture
    986 on at

    Thanks for the answer @Abdou,
    I had a similar requirement in one of my application so I used the above syntax and it worked for me
    (In the image attached: IssueFirmTracker - is the form name)
    Syntax: Form_Name.Mode = Form.Edit

    Please like my response if it helped.

    Screenshot 2023-01-03 162000.png
  • adampope Profile Picture
    24 on at

    Try hiding it in 'view' mode, then it'll be visible in the other two; so in the 'Visible' setting:
     

    If(Form1.Mode = FormMode.View, false, true)

     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard