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 / After creating and sub...
Power Apps
Unanswered

After creating and submitting a record on a screen, a different record appears

(0) ShareShare
ReportReport
Posted on by

In my PowerApp, I have a screen that has a gallery showing all the items previously created by the user. If the user selects an item, they navigate to a separate screen to see the details of the record. The separate screen's form's item is the gallery.selecteditem. This works perfect! If the user wants to enter a NEW record, they are sent to the same separate screen to enter the details and when they click submit, a random entry from the first screens gallery is displayed. Is there a way to make the separate screen STAY on the newly entered record instead of showing another record (perhaps the last selected record from the first gallery screen)? 

Perhaps there is a better way to do this, but my second screen has so many fields in it that it doesn't work to have the gallery and form on the same screen.

Categories:
I have the same question (0)
  • Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at

    I'm sorry, I don't quite understand.  When they click submit, a random entry from the first screen's gallery is displayed.  Where is that displayed?  In the gallery?  In the form?

  • AnnetteM Profile Picture
    on at

    The first screen has a gallery of all the items in the list.
    The second screen has a form with the details.
    From the first screen, a user may click an item from the gallery to open the second screen and see the details. They also have an option to enter a new entry. The second screen's item property on the form is the gallery.Selected. So, if they click the item from the gallery, it will open the second screen showing the gallery's selected item. If they click the button on the first screen to enter a new record, the second screen will open, blank, and allow them to enter a new record, but when they click the submit button (submitform action), the form will submit, but most likely the last value from the gallery.selected, is what is showing after the form has been submitted. In otherwords, the form does not stay on the same record, but reverts to the last item from gallery.selected. Hope that clarifies!

  • Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at

    What is your formula for the button that they use to enter in a new record?

  • Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at

    Ok I think I have an idea:

     

    You can use a variable to keep track of whether the user is editing an existing item or creating a new record. You'll need to update the OnSelect properties to set the variable.

     

    To navigate to the Edit Form screen when editing an existing item, set the OnSelect property to something like this:

    Set(varIsNew, false); Navigate(EditFormScreen)

     

    Update "EditFormScreen" to your actual screen name that you are navigating to.  To navigate to the Edit Form screen when creating a new record:

    Set(varIsNew, true); Navigate(EditFormScreen)

     

    Then for your Item property of the form, try:

    If(varIsNew, Defaults('YourSharePointList'), Gallery1.SelectedItem)

     

    It will probably need to be tweaked a bit, I don't know enough about how you are creating a new item

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 103

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
wolenberg_ Profile Picture

wolenberg_ 67 Super User 2026 Season 1

Last 30 days Overall leaderboard