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 : tGLyZ43CO5/auwfkUc69NS
Power Apps - Building Power Apps
Answered

Cancel Button Not Working in View Mode

Like (1) ShareShare
ReportReport
Posted on 9 Dec 2021 21:30:45 by

I've created custom buttons at the bottom of my form, which is integrated with a SharePoint List.  Everything is working fine other than when I double-click an existing entry.  The form goes into view mode, which means I hide my "Submit" button and my "Close" button's X value changes so it's centered on the form.  My close button's OnSelect value is always set to RequestHide().  When I click the close button, nothing happens.  If I click "Edit All" at the top and the form goes into edit mode, it works fine (also works fine when creating a new entry).  Is there something special I need to set for OnSelect when the form is in view mode?

 

BTW, I checked to be sure and my hidden Submit button does not cover or intersect with the Close button.

Categories:
  • Community Power Platform Member Profile Picture
    on 14 Dec 2021 at 20:42:45
    Re: Cancel Button Not Working in View Mode

    Thanks for your help.  I guess, by design, buttons are inactive when the form is in view mode?  Since I don't want the form to always open in edit mode, I ended up setting the Visible filed for my custom datacard to "!(SharePointForm1.Mode = FormMode.View)", so it just hides the buttons when in view mode.  Kind of a good reminder that you're only viewing the form.

     

    I think what you're saying is the more involved solution would be to put the entire form into edit mode by default, then use a variable to determine when the fields should be in view mode.  I think that means I'd have to set code for each field's DisplayMode property so it uses the variable to determine its mode.  That would work, but I'd have to remember to do that for any new fields as well.  Thankfully, for this solution, hiding the buttons when viewing is acceptable.

     

    I'm chalking this up to just one of the quirks of Power Apps!

  • Verified answer
    Gerard Simpson Profile Picture
    2,987 Moderator on 10 Dec 2021 at 23:45:40
    Re: Cancel Button Not Working in View Mode

    Hi @UkimanPA  - I tried it there with button and icon and see what you mean. It doesn't matter even if you change the displaymode of the controls and datacard to edit, it still respects the parent (screen) displaymode as view when the item is opened.

     

    You have a couple of options:

     

    1) Change the 'OnView' property of the SharePoint Integration object to be edit by default when someone opens an item (as shown below) - If you don't want everything going to edit, you could trigger a variable 'OnView' to ensure all but your button datacards remain in view until you switch the variable to true by selecting edit in the Sharepoint integration object. It's a bit of work, but if you wanted that view/edit function, whilst also keeping your button positioning that you already have in place, you could do something like that.

    AmDev_0-1639178598533.png

     

    2) Leave the button outside your form, but make your canvas wider and wrap your fields to show up to 4 fields side by side so it all fits on one screen with no/minimal need to scroll and then you wouldn't loose the button.

     

    Neither options may be perfect for your use case, but will hopefully be of some use.

  • Community Power Platform Member Profile Picture
    on 10 Dec 2021 at 21:52:49
    Re: Cancel Button Not Working in View Mode

    Thanks for the suggestion.  That did work, but the problem is if it's not in a datacard, then it doesn't scroll with the form...  or is there a way to do that?  I am confused why the card would cause an issue when the form is in view mode.  It was just an empty custom card to contain the buttons.

  • Gerard Simpson Profile Picture
    2,987 Moderator on 10 Dec 2021 at 20:53:54
    Re: Cancel Button Not Working in View Mode

    @UkimanPA  you mentioned it's in the same card?... try installing it on the screen and not inside a datacard

  • Community Power Platform Member Profile Picture
    on 10 Dec 2021 at 17:07:34
    Re: Cancel Button Not Working in View Mode

    The visibility of the button is working fine, but I tried your suggestion anyway.  Same result.

  • Himanshu_90677 Profile Picture
    416 on 10 Dec 2021 at 17:02:46
    Re: Cancel Button Not Working in View Mode

    Try visible ,false, true, for button with "IF" condition

  • Community Power Platform Member Profile Picture
    on 10 Dec 2021 at 16:47:07
    Re: Cancel Button Not Working in View Mode

    Thanks.  I added a new button but that one's not working either.  It's so strange.  The new button is in the same card as the old one.  I only customized two properties:

    • Visible: SharePointForm1.Mode = FormMode.View
    • OnSelect: RequestHide()

    The button doesn't seem to even click and it certainly doesn't close the form.  I feel like there's something with buttons or cards or form modes that I'm just not understanding. 🙄

  • CNT Profile Picture
    10,919 Super User 2024 Season 1 on 09 Dec 2021 at 21:54:18
    Re: Cancel Button Not Working in View Mode

    @UkimanPA RequestHide() works in View Mode as well. Just to be sure, and another button and give it a try.

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