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

Re: SubmitForm command changes Gallery.Selected item record - Error is back

THANKS!!! THIS works ! 

JoshHoughton
Level: Powered On

Re: SubmitForm command changes Gallery.Selected item record - Error is back

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

JenVitug
Level 8

Re: SubmitForm command changes Gallery.Selected item record - Error is back

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 

 

 

 

JenVitug
Level 8

Re: SubmitForm command changes Gallery.Selected item record - Error is back

@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 

Highlighted
JoshHoughton
Level: Powered On

Re: SubmitForm command changes Gallery.Selected item record - Error is back

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

 

Helpful resources

Announcements
thirdimage

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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (3,772)