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 / Cancel Button Not Work...
Power Apps
Answered

Cancel Button Not Working in View Mode

(1) ShareShare
ReportReport
Posted on 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:
I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

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

  • Community Power Platform Member Profile Picture
    on at

    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. 🙄

  • Himanshu_90677 Profile Picture
    416 on at

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

  • Community Power Platform Member Profile Picture
    on at

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

  • Gerard Simpson Profile Picture
    2,987 Moderator on at

    @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 at

    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.

  • Verified answer
    Gerard Simpson Profile Picture
    2,987 Moderator on at

    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 at

    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!

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