I have a display and edit screen. The movement between the two work real well. However, if I display a list entry, then edit it and click on submit, it will go back to the display screen with the list entry I just edited (which I want), but then it refreshes within a second and go to the list entry that is listed first in the sharepoint list.
Is there a way to keep it on the list entry that I just edited?
Solved! Go to Solution.
You might want to try avoiding the reference to Gallery1.Selected and instead having the Gallery1 OnSelect property set a variable and using that variable in the Item property for the forms.
If something is causing Gallery1 to refresh, a different (usually first) record becomes the currently selected item (but should not trigger the OnSelect) which causes your forms to change the record they are displaying in the current configuration.
I tried changing the button OnSelect attribute to point back to the EditScreen, but it still goes to the DisplayScreen. This is what I have for the OnSelect:
Ok I think I have the var set on the OnSelect of the gallery:
So how would I set the item property on the forms from here?
Just to see what it would do, I changed the OnSelect of the submit button on the EditScreen to navigate back to the ListScreen
I then ran the screen and checked it out. When I hit submit, it went to the ListScreen, then a second later went to the DisplayScreen (showing the first entry on the list). Just a little more info.
I was looking around and found that I had a OnSuccess statement in there:
After removing it, I was able to get the EditScreen to stay up. So, would I be able to use a var with the OnSuccess screen to keep the current display screen on the ID I just edited? If so, how would I right that?
@Jchopp In your case I believe its better not to use a variable in the OnSelect of the Gallery. It would be better to comment out Set(variableID,Gallery1.Selected.ID) and set the items property for both the Display and Edit Forms to gallery1.selected. This will keep a clear link between the gallery and your forms and avoid jumping around.
@CNT I have put everything back like you suggested, and just pointed the "Save" button to go to the ListScreen (Main screen for the app) and everything works that way. Unless you have something else for me to try with the display, I will just leave it like that right now.
@Jchopp I would suggest to leave it. Glad o help!
Please remember to give a 👍 and accept the solution as it will help others in the future.
Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.
Your chance to join an engaging competition of Power Platform enthusiasts.