cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Romansx
Level: Powered On

Components global variables looses its value..

i have a issue on my custom component that ive working for a while...
Actually i cant work with variables in my component and i saw me forced to use the classic collection instead.
For example, i have a button that sets a global variable to "true" and works fine... but when pressed any other button that do another action or sets another variable automatically the first var gets empty.
And when i go to view all the variables of the component in "File/variables/COMPONENT" are all blank as its never gets any value...
I dont know what must be the problem... anyone having the same issue???

3 REPLIES 3
BrianR
Level 10

Re: Components global variables looses its value..

Constantly having issues like this, both with components and other areas.

 

Best thing to do is to go into each property where its happening, copy the value out of it, put garbage (anything) into it, and then repaste it back in.  

Often this "fixes things" - until the next time it happens.


PowerApps Studio has been a MESS lately...  even more so than usual...

Community Support Team
Community Support Team

Re: Components global variables looses its value..

Hi @Romansx ,

I'm afraid it's not supported to use global variable in components currently in PowerApps.

The thing is - Global variables, ScreenNames, and pretty much ANYTHING specific to your App is a no-no for a component.  This (IMHO) is by design.  Components are meant to be portable.  You should be able to create a component in one place and use it in many.  If it relies on global variables or other aspects of your App - it will not be portable.

Here're some issues for your reference:

https://powerusers.microsoft.com/t5/General-Discussion/Components-Global-variable/m-p/242546

https://powerusers.microsoft.com/t5/Creating-Apps/Components-and-Global-Variables/m-p/241650

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Romansx
Level: Powered On

Re: Components global variables looses its value..

@v-yutliu-msft  what??? you definitely can set variables in components... i know well that these var's have specific validation inside de component and cant call outside them... thats supposedly correct...

what I mean is that the variables within the component lose their value... maybe I misspoke and said global variables,

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Tomorrow, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 124 members 4,538 guests
Please welcome our newest community members: