Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at
    Re: After creating and submitting a record on a screen, a different record appears

    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

  • Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at
    Re: After creating and submitting a record on a screen, a different record appears

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

  • AnnetteM Profile Picture
    on at
    Re: After creating and submitting a record on a screen, a different record appears

    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
    Re: After creating and submitting a record on a screen, a different record appears

    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?

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1