cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

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?

15 REPLIES 15

THANKS!!! THIS works ! 

@JenVitug wrote:

@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.


 

Hi Jen Vitug

I'm glad the custom variable solves your gallery.selected problem. As for using the variable in different screens, when you create a variable in the Navigate command it can only be used in the screen your are navigating to, BUT you can create a clone of the variable with the same name in the next Navigate command so you can share the variable with subsequent screens, here is an example statement:

 

Navigate(ScreenTitle, ScreenTransition.Fade, {CustomVariable: CustomVariable})

As you can see... it will create a clone of the variable and pass it into the next screen. The next screen can then access your variable to reach the data from the initial  Gallery.Selected. 

 

Let me know if this works for you 🙂 

hi @JoshHoughton

 

When i tried the cloning, it sends me this error about Context variables being binding only to 1 specific screen:

 

2018-05-04 (1).png 

 

 

 

@JoshHoughton

 

Can't i just create a global var via SET (e.g. "  SET(FixSbo,BrowseGallery1.Selected)  "

at the Gallery's button before the NAVIGATE function ?

 

Will I be able to use this  Global Var in the subsequent navigate  to other screens such that in the navigated-to Screen the FORM.item is set to the Global Variable 

@JenVitug wrote:

@JoshHoughton

 

Can't i just create a global var via SET (e.g. "  SET(FixSbo,BrowseGallery1.Selected)  "

at the Gallery's button before the NAVIGATE function ?

 

Will I be able to use this  Global Var in the subsequent navigate  to other screens such that in the navigated-to Screen the FORM.item is set to the Global Variable 


 

I have not tried using global variables before, and my Powerapps license has expired now so I can't run any tests. It looks like your navigate function is redundant though because you are trying to navigate to the same screen (ThisItem.Screen?) that the image is already in... so you are creating a clone of the variable in the same screen, this should not be necessary. Should your image be trying to navigate to a different screen? If you stay in the same screen your context variable should still be accessible. 

 

Examples:

Gallery Screen

Navigate(ScreenTitle1, ScreenTransition.Fade, {CustomVariable: Gallery.Selected)

 

ScreenTitle1 - Button 1

Navigate(ScreenTitle2, ScreenTransition.Fade, {CustomVariable: CustomVariable})

 

etc.

 

Your solution is genius, Josh! Thanks for sharing it!

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (20,808)