cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Kudo Kingpin
Kudo Kingpin

Re: SubmitForm command changes Gallery.Selected item record

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

Highlighted
Anonymous
Not applicable

Re: SubmitForm command changes Gallery.Selected item record

Josh, thank you. 

 

Please see

 

https://powerusers.microsoft.com/t5/PowerApps-Forum/Detail-Record-Card-Switches-After-Use-of-quot-Pa...

 

it provides a complete solution that keeps the current record selected AND updates are reflected in the form.

 

W.

Highlighted
Helper II
Helper II

Re: SubmitForm command changes Gallery.Selected item record

Staff, is this acknowledged as a bug in PowerApps?

Highlighted
Frequent Visitor

Re: SubmitForm command changes Gallery.Selected item record

Hello,

I have the same problem even with the solution of using a variable set to the Gallery.Selected in the navigation.

 

First screen:

  • EditForm('Form part 1') then Navigate( Screen_1_Contract; None;{MyContract: 'GalleryContracts'.Selected})

 

Screen_SyntheseContrat;

  • 'Form part 1' item property = MyContract
  • Next button : SubmitForm('Form part 1')
  • 'Form part 1' OnSuccess code : Navigate(Screen_End, None)

Any Idea / solution ?

Advocate II
Advocate II

Re: SubmitForm command changes Gallery.Selected item record

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. 

 

Highlighted
Frequent Visitor

Re: SubmitForm command changes Gallery.Selected item record

Hi Josh, For you first remark on EditForm and Navigate on the same line, I don't remenber why 😞 I also have a new button with NewForm and Navigate on the same line. So I do the same for Edit. May be I'm wrong, I'll try without EditForm. 'Form part 1' DefaultMode is set to Edit. It should work. For the 2nd point, on the Screen_SyntheseContrat. I also use a variable to navigate to the Screen_End (it ws not in my previous post). - 'Form part 1' item property = MyContract - Next button : SubmitForm('Form part 1') - 'Form part 1' OnSuccess code : Navigate(Screen_End, None, ;{MyContract: 'GalleryContracts'.Selected}) I've made several tests to determine where is the problem. If I remove the code from the OnSuccess I have the same behaviour so, this is the SubmitForm which causes the data to change.
Highlighted
Advocate II
Advocate II

Re: SubmitForm command changes Gallery.Selected item record

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 Smiley Frustrated

Highlighted
Frequent Visitor

Re: SubmitForm command changes Gallery.Selected item record

I've changed the navigation function to Navigate(Screen_End;ScreenTransition.None;{MyContract: MyContract}) nut I still have the same behavior. I probably use 'GalleryContracts'.Selected.xxxx somewhere in Form part 1 ... I'm checking
Highlighted
Frequent Visitor

Re: SubmitForm command changes Gallery.Selected item record

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? 

Highlighted
Advocate V
Advocate V

Re: SubmitForm command changes Gallery.Selected item record

I am also facing this issue. Any solution so far?

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,198)