cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
davidstone
Level 8

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!

wedwards
Level: Powered On

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.

sfishe
Level: Powered On

Re: SubmitForm command changes Gallery.Selected item record

Staff, is this acknowledged as a bug in PowerApps?

FredA
Level: Powered On

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 ?

Highlighted
JoshHoughton
Level: Powered On

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. 

 

FredA
Level: Powered On

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

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

FredA
Level: Powered On

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

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? 

jvdlinden
Level 8

Re: SubmitForm command changes Gallery.Selected item record

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

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,029)