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 / display form change to...
Power Apps
Answered

display form change to edit form or new form based on button click.

(0) ShareShare
ReportReport
Posted on by 142

Request_Add_New_Edit.JPGI have a screen with two gallery and a form and two buttons. One button when click it create an add new form and other button change display to edit mode.

 

I was able to make the cascade galley works and the form can display a record selected by second galley. I would like to implement the onSelect edit button to change the display form to edit form. And when I click add new it change to edit new form.  Is that possible I would like to stay in the same screen ?

 

 

 

Request_Add_New_Edit.JPG
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

    @skong ,

    You simply need to choose between

    EditForm(YourFormName)

    for Edit Mode and 

    NewForm(YourFormName)

    for New Mode and 

    ViewForm(YourFormName)

    to go back to read-only.

    Is this what you are meaning?

     

    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.

  • skong Profile Picture
    142 on at

    The FormViewer1 is a display form. When I changed the onSelect to the add button to NewForm(FormViewer1) it complains I have an invalid arguments and on the edit button to EditForm(FormViewer1) I got the same error message. 

  • WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

     

    @skong 

    If you have added a new Display Form, this will not work (you cannot "convert" it) - you will need to replace it with a new form (Edit)

     

     

    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.

  • skong Profile Picture
    142 on at

    If I replace the form to new form(edit) how can I change to display mode with a click button ?

  • WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

    @skong ,

    As per my previous post

    EditForm(YourFormName)

    for Edit Mode and 

    NewForm(YourFormName)

    for New Mode and 

    ViewForm(YourFormName)

    to go back to read-only.

     

    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.



  • skong Profile Picture
    142 on at

    I change the form to edit form. When I select an item to gallery2 it opened in edit mode with selected item filled in the form. When I click the add button it change the form to new form by resetting the form which is good. But when I go back to gallery2 select another item the form no longer filled with selected item.  Do you know why ? The item property of the form is set as gallery2.selected. 

  • Verified answer
    WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

    @skong , 

    Change the Item to 

    LookUp(
     YourListName,
     ID=Gallery2.Selected.ID
    )

     

    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.

     

  • skong Profile Picture
    142 on at

    I change item to your code doesn't work. I end up on the select button on gallery2 add this                                      Select(Parent); EditForm(Form3);  I will accept your suggestion as solution. Thank you very much for your help.

  • WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

    @skong ,

    Select(Parent) is inferred when you select an item in a gallery (it becomes the GalleryName.Selected), so you should not need to do it once you select an item (I do not have it on probably over 100 galleries). You do however need to put the EditForm(Form3) to instigate the edit.

  • skong Profile Picture
    142 on at

    Thanks again. By the way I change back to gallery2.selected the code still work.

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard