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 form mode depen...
Power Apps
Answered

Change form mode depending on different buttons

(0) ShareShare
ReportReport
Posted on by 321

Hi,

 

My problem is as follows.

 

I have a screen in my app which contains a gallery and a form

 

The gallery is linked to the form (which I have applied a variable to popup on select of the icon), within the gallery I have an edit icon which is linked to the form (popup).

I also have a button outside of the gallery, which link to the form, which is to add a new item

 

What I want to achieve is as follows.

 

Id like the button within the gallery, to populate all the details into the form based on the selected gallery item,

I’d like the button outside of the gallery to open the same form but a blank new form.

 

 

Any help appreciated, thanks in advance

Categories:
  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    For the button inside the gallery you would use the EditForm() function and for the one outside the gallery you wuld use the NewForm() function.  That will change the form mode.  Then have the Item property of the form adjust based on the form mode.

    EditForm, NewForm, SubmitForm, ResetForm, and ViewForm functions in Power Apps - Power Apps | Microsoft Docs

  • JimboSey Profile Picture
    321 on at

    @Pstork1 

     

    In my onselect property of the icon with the gallery at the moment I currently have a variable to trigger the popup of the form,

     

    Code as follows; UpdateContext({_ShowLLForm:true})

     

    What would be the code I add to this to show the form and populate the item of the gallery item selected?

     

    Thank you.

  • Verified answer
    Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    For the Gallery button it should be 

    EditForm(formname);UpdateContext({_ShowLLForm:true})

    And for the one outside the gallery just

    NewForm(formname)
  • JimboSey Profile Picture
    321 on at

    Worked a treat, thank you @Pstork1 

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard