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 / Gallery and form on sa...
Power Apps
Answered

Gallery and form on same screen - view vs edit mode

(0) ShareShare
ReportReport
Posted on by

I have a gallery and a form on the same screen. I also have a button for the user to add a new item. When they click to add a new item, I would like the form to be in edit mode, obviously. Same is true if they select an item from the gallery where the status of the item is not paid -- this will allow them to change the item up until the point it gets paid. Once the item is in a paid status, if they click on the item from the gallery, I would like the form to only display in view mode. Is that possible?

Categories:
  • Verified answer
    PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @AnnetteM Absolutely.

     

    So on your Form DisplayMode Property use this formular: 

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

     

    On your button.OnSelect Property add this formular:

    Set(varIsEditMode,true)

     

    On Your Gallery.OnSelect Property use something like this:

    If(ThisItem.IsPaid,Set(varIsEditMode,true),Set(varIsEditMode,false))

     

     

    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.

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi,

    Yes It is possible. On select property of new button you can add below formula -

    Set(varFormMode, “new”)

    on select property of gallery or edit icon you can use -

    Set(varFormMode, “edit”)

    You can use below formula on Default mode of form 

    If(varFormMode=“new”, FormMode.New, If(varFormMode=“edit”, If(Gallery1. Selected.Status. Value <> “ Paid”, FormMode.Edit, FormMode.View)))

    assumptions -

    gallery name is Gallery1

    Status column is of type choice and name is Status

  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @AnnetteM 

    True what @NandiniBhagya20  wrote. It is FormMode not DisplayMode...

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @AnnetteM 

    In your Gallery OnSelect, set the following formula:

    Set(glbCurrentRecord, ThisItem); Reset(yourFormNameHere)

    On your Add button/Icon, set the following formula:

    Set(glbCurrentRecord, Defaults(yourDataSourceNameHere)); Reset(yourFormNameHere)

    In the DefaultMode property of your form, set the following:

    If(glbCurrentRecord.PaidStatus = "Paid", FormMode.View, FormMode.Edit)

     

    Substitute names accordingly above.

     

    I hope this is helpful for you.

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard