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 / Change displaymode of ...
Power Apps
Answered

Change displaymode of displayform in "live"

(0) ShareShare
ReportReport
Posted on by 91

Hi,

 

is it possible to update the context of a display Form to displaymode.edit within the same screen/without needing to reload anything etc? 

 

I would like to have a display form with displaymode.view first, and update the context onselect of a button so the user can edit the values. 

 

I dont seem to get it to work... 

 

Thanks!

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Jasper1234 

    You can set a context variable as the property of the display mode in a button or icon outside of the form using its OnSelect property to toggle the display mode of the form.

    UpdateContext({eform:!eform})

    and make the DisplayMode property of the form:

    If(eform,DisplayMode.Edit,DisplayMode.View)

    Don't forget to set the default for the form in the OnVisible property of the screen.

    UpdateContext({eform:false})

     

  • Jasper1234 Profile Picture
    91 on at

    @Drrickryp 

     

    thanks a lot - but i think you overestimated my powerapps skills. I do understand the basic principle of what you wrote as solution, but im already stumbling at the first step. 

     

    One addition, as it may make a difference: i have a gallery to select an item, i use displayitem. In the next detail screen the initial displaymode is set to "view". This is the context im trying to change to "edit" upon clicking a button. 

     

    I am not familiar with the "eform" you used, i expect its a placeholder in your advice, but im not sure. 

    However, if i use it exactly the way you wrote, the button and the screen dont show any errors. Only the form itself shows an error (the property on this control expects enum values. the rule produces text values which are incompatible). 

     

    Any thoughts or further advice?

     

    thanks

     

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Jasper1234 

    eform is just an arbitrary name for a variable. It could have been anything.  Based on what you are now telling me, I am assuming that you have an edit form on a different screen than your gallery and you wish to initially view that form in view mode but want the ability to change the form mode to edit with a button on the screen containing the form.  That being the case,  set the default property of the form to view as shown in the first screenshot. _3.jpg2.jpg1.jpgThe button will toggle the view/edit properties of the form as shown in the top and bottom screenshots.  I also added a SubmitForm button and toggled its display properties to be disabled or edit based on the form's display mode. 

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 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard