web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Apps
Answered

Record Save

(1) ShareShare
ReportReport
Posted on by 1,265
I have a Power App where I have a button that submits (saves) the record entry.  When I submit, the record changes to another record (rather than remaining on the current).  It remains in the data entry screen (does not return to the gallery).
 
The button OnSelect is SubmitForm(frmDataEntry)
 
 
Any suggestions to what would create this issue?
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,414 Super User 2025 Season 2 on at
    HI @RJF61
     
    It would be helpful to have pictures.
     
    I believe you are saying that the Form itself, populates with another records data, versus staying on the one you just submitted.
     
    Since you are using a Gallery I would
     
    1) Please verify what your Item property is set too in your Form
    2) its most likely refreshing the data source, which will trigger the SharePoint list to also refresh, as its datasource is refreshing, which will not unselect the record you had and probably selecting the first Row every time.
     
    Can you verify if the data is the 1st row listed in the Gallery each time?
     
    Also can you verify if you have any Refresh(datasource)  happening after your submit? Maybe in the OnSuccess?
     
    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.
    Thank you!
    Sincerely, Michael Gernaey
  • RJF61 Profile Picture
    1,265 on at
     
    Thanks for the response!
     
    Yes, you are correct that the "record populates with another records data, versus staying on the one you just submitted."
     
    The data entry form (frmDataEntry) Item Property is set to home galHome.Selected (which is the Home Screen Gallery).  It appears it is refreshing to last "Saved" record.  If I enter records quickly (prior to Power App updates) it appears to refresh to the first record.
     
    In the OnSuccess of the form, "False" is present.  At this time, I have not created an OnSuccess Screen for data save verification.
  • Verified answer
    timl Profile Picture
    36,393 Super User 2025 Season 2 on at
    Hi @RJF61
     
    If you want the from to remain on the record that you edited after clicking the button, I would suggest the following. 
     
    In the OnSelect property of your galHome gallery, set a variable before navigating to the screen that contains your form.
     
    Set(varSelectedItem, ThisItem);
    Navigate(YourEditScreen)
    
    Next, set the Item property of your form to varSelectedItem. By doing this, the record should not change to another record when you save.
     
    If you want to navigate back to your home screen after saving the record, you would call Navigate in the OnSuccess property of your form (as opposed to leaving it set to false).
     
    Navigate(YourHomeScreen)
     
     
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,414 Super User 2025 Season 2 on at
     
    It depends on which direction you want to do.
     
    @timl gave a good suggestion for the form.
     
    However, (not his solutions issue), when you go back, your Gallery is selecting the incorrect record, which means your .Selected (and if you have anything highlighted to show it's the one selected), it will not show the correct one selected (if it does that's a whole other bug then).
     
    Which means, I would also use the variable to re-select the correct row in the Gallery. Essentially this way your form can keep the .Selected and just keep the gallery on the correct record, but there is zero harm in using the Global in both places either.
     
    You can also use a local context record on the Gallery (same as timl said) but as a Context value, then use the Navigate to Pass the value to the Form and use that.
     
    All of the options will work, I was just curious if you needed the gallery to stay on the record you selected to Edit, so the user experience is, oh crud I scrolled down 30 records, clicked, came back now the first (or last) row is selected let me go find my record again.
     
    I will also add one last thing. Since we don't know if you are applying filtering etc in your Gallery items it "may" have an impact on the answer (not to get the data to the form) but reselecting the write row, if for any reason the filters are resetting.
     
     
    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.
    Thank you!
    Sincerely, Michael Gernaey
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard