cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wolf70
Level: Powered On

SubmitForm command changes Gallery.Selected item record - Error is back

Hi,

while the error should have been solved a while ago (see other thread with same title), it is now back:

When sending "SubmitForm" it clears the Gallery.SelectedItem and shows incorrect information on the previous screen.

Any ETA when this problem will be gone again?

14 REPLIES 14
Community Support Team
Community Support Team

Re: SubmitForm command changes Gallery.Selected item record - Error is back

Hi wolf70,

 

I have seen your another thread about this issue. The thread link should be:
https://powerusers.microsoft.com/t5/PowerApps-Forum/SubmitForm-command-changes-Gallery-Selected-item...

 

According to your description, I newly create an auto-generated app based on SharePoint list, the Item property of the EditScreen is set to BrowseGallery1.Selected. When I click the SubmitForm control to save changes I have made on the selected item, the changes will be saved properly, I don’t get the issue you mentioned.

 

I also test with an old app I created before, it also works as expected.

 

Not sure if this is a temporary issue, could you please try it again on your side? If you are still having this issue, please feel free post back.

 


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
wolf70
Level: Powered On

Re: SubmitForm command changes Gallery.Selected item record - Error is back

You are correct, the item will save correct. However when you do the back() (or navigate to) to the previous screen it will show you the first item in your root list, not the one that you selected originally.

To be more presice:

Structure is: Main Screen (gallery) -> View Screen -> Edit Screen

When the Edit Screen (after using FormSubmit) goes back to the view screen, the selection is lost. 

Storage of the items is a Sharepoint List. Will do more checks later today....

JoshHoughton
Level: Powered On

Re: SubmitForm command changes Gallery.Selected item record - Error is back

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. For your View and Edit forms, change the Item property 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.

JoshHoughton
Level: Powered On

Re: SubmitForm command changes Gallery.Selected item record - Error is back

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. 

Fkulieb
Level: Powered On

Re: SubmitForm command changes Gallery.Selected item record - Error is back

hi

i made powerapps , contains the main menue , then the teachers Depatrements ,then sections depond on the teachers , then each section have students the last thing , i made edit form to edit data for each student , the problem is when i choose the tenth student and enter data after that made submit form , its return back to first student in the sharepoint list.

 

can help me to fix this problem

I tried the prevous solution it work fin form but in the screen its not work , return back to First student 😞

 

JoshHoughton
Level: Powered On

Re: SubmitForm command changes Gallery.Selected item record - Error is back

Hi Fkulieb

 

I already posted a solution to this problem in this thread... have a look at my comment in the thread and see if it solves the problem. If you are unsure, please can you reply with the following:

- Your Gallery's OnSelect statement (refer to the properties menu on the right)

- Your Form's Item statement (again, refer to the properties menu on the right)

 

 

My solution works by creating a variable from the Gallery item then anchoring the form to the variable rather than the gallery. Here are some example statements for you:

Gallery: On Select: Navigate(PageTitle, ScreenTransition.Fade, {CustomVariable: Gallery.Selected})

Form: Item: CustomVariable

 

Keep me informed, J

Fkulieb
Level: Powered On

Re: SubmitForm command changes Gallery.Selected item record - Error is back

 Thank you very much for reply me , This is what i did , thank you again 🙂

 

my apps.png

JenVitug
Level 8

Re: SubmitForm command changes Gallery.Selected item record - Error is back

I have the exact same problem.  AFTER submitForm, it saves new changes correctly but returns the form with the Gallery.Selected  set at first record of the gallery 😞 ;(   ;(

JenVitug
Level 8

Re: SubmitForm command changes Gallery.Selected item record - Error is back

@JoshHoughton your solution works for the first navigated to Screen , but the custom variable is not recognized in the subsequent  screens (my screens are selected thru TABs.

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,995)