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!
Solved! Go to Solution.
That's a neat and simple solution - I'll be sure and try it using the new 'set' command they just released too!
Josh, thank you.
Please see
it provides a complete solution that keeps the current record selected AND updates are reflected in the form.
W.
Staff, is this acknowledged as a bug in PowerApps?
Hello,
I have the same problem even with the solution of using a variable set to the Gallery.Selected in the navigation.
First screen:
Screen_SyntheseContrat;
Any Idea / solution ?
Hi FredA
I'm slightly confused by what you've posted... looking at your "First Screen" statement, why would EditForm and Navigate be on the same command line? Shouldn't your EditForm be in the Screen_SyntheseContrat?
On your 'Form part 1' OnSuccess property, you have added a command to navigate away from the screen with the form on it... If your form is changing the Gallery.selected record, could it be because you are only using the variable in the form on the Screen-SyntheseContrat page and not the Screen_End page? Could you establish what is on your Screen_End page? If it has another form then it will also need to use the variable.
It's odd that you have the same behaviour if you remove the OnSuccess code.
I could see where the problem might be in your original OnSuccess command:
Navigate(Screen_End, None, ;{MyContract: 'GalleryContracts'.Selected})
Doing it this way would definitely cause you to continue to have the error because when you trigger OnSuccess, the gallery changes it's selected item and you are recreating the MyContract variable with the new Gallery.Selected (aka the first record).
If the problem was just caused by this above command you could simply put
Navigate(Screen_End, None, {MyContract: MyContract}) - this would create another variable of the same name and value to use in the Screen_End page... what you have to remember is that when you navigate and create a variable, the variable can only be used in the screen that you are navigating to, it cannot be used in any other screens, so you have to keep re-creating the variable in each screen that you navigate to afterwards.
If you leave the OnSuccess code empty, presumably it should stay on the Screen_SyntheseContrat page? If this is the case, is the form on that page changing it's data after you save it or is it keeping the same record open?
Unfortunately my trial has expired so I can't reference my own solution anymore
This solution works, kind of.
When there is a column that is not unique (department, for instance) that is used as the selected column, then returning to the Gallery.Selected does not necessarily get you back to the record you are editing or edited. I thought that there may be a way to get back to the selected record, but it just returns to a record that has the department. For instance, if I have two departments - Tax and General Business - and I change a record that is assigned as Tax to General Business - then it returns me to the next "Tax" record. Not exactly what I want.
Any suggestions?
I am also facing this issue. Any solution so far?
User | Count |
---|---|
254 | |
106 | |
84 | |
51 | |
43 |