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 Platform Community / Forums / Power Apps / SubmitForm command cha...
Power Apps
Unanswered

SubmitForm command changes Gallery.Selected item record

(2) ShareShare
ReportReport
Posted on by

I have an app connected to a SharePoint list. I have a form that is in Edit Mode, and loading from a Gallery via .Selected property. After submitting changes successfully, the Edit Form control is changing the .Selected value to the first record in the data source set. This should not be happening, it should just load the currently selected record. I noticed this change today and last worked on the app late last week. Anyone know why this would happen? I haven't changed anything in the code since last week :(.

 

Thanks!

Categories:
I have the same question (0)
  • Verified answer
    murali Profile Picture
    on at

    Hello - Thanks for your inquiry.

     

    We are aware of the issue and are working on resolving this. We will let you know once we fix the problem. Thanks for your patience.

  • murali Profile Picture
    on at

    This should now be resolved. Please try and let us know.

  • Community Power Platform Member Profile Picture
    on at

    Hi Murali.

     

    I tried today but still not fixed. I have the latest update of PowerApps as well.

     

    MV

  • murali Profile Picture
    on at

    That should not be happening. I just pulled the latest PowerApps from Store and it worked for me.

     

    Here is what I did.

     

    I have an edit form whose Item is set to a Gallery's selection via Item = Gallery.Selected. I made some changes to form contents and submitted the form. The selection remained intact.

     

    Can you tell me how you have wired things up so I can try on my end?

     

    Murali

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    Looks like it works now. I had to Edit and Re-Save my app for the solution to take effect.

     

    Thanks!

     

     

  • murali Profile Picture
    on at

    Glad to hear it's been resolved.

     

    Murali

  • John Sullivan Profile Picture
    Microsoft Employee on at

    Has this bug been re-opended? I am seeing the same behaviour. After submit the edit form goes to the first item in the gallery. Not the record that was just created

  • davidstone Profile Picture
    471 on at

    I wonder if it is only an issue when your sort order is affected by your changes. For example my data is sorted by Modified, so when I update a record the sort order obviously changes and I lose my existing selection.

  • JoshHoughton Profile Picture
    73 on at

    I've had the same problem where submitting a form causes the Gallery.Selected to change and therefore the form data changes. I managed to solve the issue by passing a variable into the form from the gallery button and anchoring my form data to the variable rather than the gallery.selected. 

     

    Try this and let me know if it works...

     

    1. In your gallery, the button that navigates to the form should create a variable when navigating. Here is an example statement:

    OnSelect: Navigate(FormPage, ScreenTransition.Fade, {CustomVariable: Gallery.Selected})

    This will create a customised variable (you can change CustomVariable to any name that suits you) based on the selected record, and then the form should be anchored to the variable rather than the gallery...

     

    2. In your View and Edit forms, change the Item from Gallery.Selected to CustomVariable. When referring to specific fields you can also use the variable in this way, so rather than using Gallery.Selected.FieldName you can use CustomVariable.FieldName

     

    When submitting the form, even if Gallery.Selected changes in the background, the CustomVariable stay the same until you go back to the gallery and select a different record. 

     

    Hope this helps. 

  • davidstone Profile Picture
    471 on at

    That's a neat and simple solution - I'll be sure and try it using the new 'set' command they just released too!

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard