cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Microsoft Employee

SubmitForm command changes Gallery.Selected item record

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 Smiley Sad.

 

Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
PowerApps Staff murali
PowerApps Staff

Re: SubmitForm command changes Gallery.Selected item record

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.

Highlighted
Microsoft Employee

Re: SubmitForm command changes Gallery.Selected item record

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

 

Thanks!

 

 

30 REPLIES 30
PowerApps Staff murali
PowerApps Staff

Re: SubmitForm command changes Gallery.Selected item record

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.

PowerApps Staff murali
PowerApps Staff

Re: SubmitForm command changes Gallery.Selected item record

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

Microsoft Employee

Re: SubmitForm command changes Gallery.Selected item record

Hi Murali.

 

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

 

MV

PowerApps Staff murali
PowerApps Staff

Re: SubmitForm command changes Gallery.Selected item record

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

Highlighted
Microsoft Employee

Re: SubmitForm command changes Gallery.Selected item record

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

 

Thanks!

 

 

PowerApps Staff murali
PowerApps Staff

Re: SubmitForm command changes Gallery.Selected item record

Glad to hear it's been resolved.

 

Murali

Microsoft Employee

Re: SubmitForm command changes Gallery.Selected item record

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
Level 8

Re: SubmitForm command changes Gallery.Selected item record

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
Level: Powered On

Re: SubmitForm command changes Gallery.Selected item record

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. 

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 383 members 4,972 guests
Recent signins:
Please welcome our newest community members: